06-20-2020, 09:09 PM
If I create a template I get this (I uncommented the bottom section):
Function Hook_SetWinEventHook2
Could you give me an example command using this function where the generation of the "Safely Remove Hardware and Eject Media" tray icon is hooked (when the user plugs in a USB stick in his computer assuming there is no other USB device plugged in yet). I want to attach an action to that.
Function Hook_SetWinEventHook2
;/
function hHook event hwnd idObject idChild dwEventThread dwmsEventTime
outw hwnd ;;debug
;your code here
;;SetWinEventHook example
int hh=SetWinEventHook(EVENT_SYSTEM_FOREGROUND EVENT_SYSTEM_FOREGROUND 0 &sub.Hook_SetWinEventHook 0 0 WINEVENT_OUTOFCONTEXT)
if(!hh) end F"{ERR_FAILED}. {_s.dllerror}"
opt waitmsg 1
wait -1
UnhookWinEvent hh
Could you give me an example command using this function where the generation of the "Safely Remove Hardware and Eject Media" tray icon is hooked (when the user plugs in a USB stick in his computer assuming there is no other USB device plugged in yet). I want to attach an action to that.