Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trigger in Exe
#4
More intelligent trigger than rep - use hook. QM uses this hook for its window triggers and accessible object triggers.
Function exe_window_trigger
Code:
Copy      Help
function hHook event hwnd idObject idChild dwEventThread dwmsEventTime

if getopt(nargs)!=7
,int hh=SetWinEventHook(EVENT_SYSTEM_FOREGROUND EVENT_SYSTEM_FOREGROUND 0 &exe_window_trigger 0 0 WINEVENT_OUTOFCONTEXT)
,if(!hh) end F"{ERR_FAILED}. {_s.dllerror}"
,opt waitmsg 1
,wait -1
,UnhookWinEvent hh
,ret

;This code runs whenever a window activated.

outw hwnd

;if wintest(hwnd ...)
;,clo hwnd

Main macro:
mac "exe_window_trigger"
then do the main work


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)