code not running after I register a shell hook
Posted: 16 Oct 2019, 01:24
I used the above codes to hook the shell message, but I found the many code after that will stop running, like the "msgbox, TEST" above. The hook itself work as expected, are there anything I did it wrong?
Code: Select all
Gui +LastFound hWnd:=WinExist() DllCall("RegisterShellHookWindow", UInt,hWnd) MsgNum:=DllCall("RegisterWindowMessage", Str,"SHELLHOOK") OnMessage(MsgNum, "SwitchMessage") HSHELL_WINDOWCREATED:=1 Return msgbox, TEST