Ich glaub das der Code funktioniert da du ja sicher kein Anfänger bist..
Aber er funktioniert aufjedenfall
nicht bei mir...
Und so dumm bin ich auch wieder nicht, wenn da "If @Compiled == 1 Then" steht weiß ich das man es Compilen muss...
Also die Anzeige funktioniert aber wenn ich Neustarte dann wird die Datei nicht geöffnet..
Edit :
Hab mal gekuckt ob das manuell geht... (Ich dachte es wird vl geblockt etc.)
Und dann hab ich den Fehler gefunden...
Man braucht Adminrechte das man etwas in den Autostart Ordner kopieren kann^^
So für den ders will ;)
Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#RequireAdmin
If @Compiled == 1 Then ;nur wenn das Script eine kompilierte .exe ist
$Shortcut = @StartupCommonDir & "\" & @ScriptName & ".lnk"
If Not FileExists($Shortcut) Then
FileCreateShortcut(@AutoItExe, $Shortcut, @ScriptDir)
;ShellExecute(@StartupCommonDir) ;öffnet den Startup Ordner
EndIf
EndIf
OnAutoItExitRegister('OnAutoItExit')
HotKeySet('{ESC}', '_Exit')
Global Const $HC_ACTION = 0
Global $hStub_MouseProc = DllCallbackRegister("_MouseProc", "long", "int;wparam;lparam")
Global $hmod = _WinAPI_GetModuleHandle(0)
Global $hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($hStub_MouseProc), $hmod)
Func _MouseProc($nCode, $wParam, $lParam)
Local $event, $info, $iX, $iY, $mouseData = "", $wheelData = ""
$info = DllStructCreate("int X;int Y;dword mouseData;dword flags;dword time;ulong_ptr dwExtraInfo", $lParam)
$iX = DllStructGetData($info, 1)
$iY = DllStructGetData($info, 2)
$mouseData = DllStructGetData($info, 3)
If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
If $nCode = $HC_ACTION Then
Switch $wParam
Case $WM_MBUTTONDOWN
_MButton(1)
Case $WM_MBUTTONUP
_MButton(0)
EndSwitch
EndIf
Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
EndFunc
Func _MButton($iDown)
If $iDown Then
ToolTip(@HOUR & ':' & @MIN & ':' & @SEC) ; Anzeige Tooltip solange Middle gedrückt
Else
ToolTip('')
EndIf
EndFunc
Func _Exit()
Exit
EndFunc
Func OnAutoItExit()
_WinAPI_UnhookWindowsHookEx($hHook)
DllCallbackFree($hStub_MouseProc)
EndFunc
While True
Sleep(50)
WEnd
Danke ! nochmal ^^