Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get notification when target window changes size/state
#1
How to get notification when target window changes position/size/state?
#2
Macro Macro2909
Code:
Copy      Help
int hhLoc=SetWinEventHook(EVENT_OBJECT_LOCATIONCHANGE EVENT_OBJECT_LOCATIONCHANGE 0 &sub.HookProcLoc 0 0 WINEVENT_OUTOFCONTEXT|WINEVENT_SKIPOWNTHREAD)
opt waitmsg 1
wait -1
UnhookWinEvent hhLoc


#sub HookProcLoc v
function hHook event hwnd idObject idChild dwEventThread dwmsEventTime

;This code runs whenever a window, control, accessible object, mouse pointer or caret is moved or resized.

;outw hwnd
if(!hwnd) ret ;;probably mouse
;out idObject
if(idObject!=OBJID_WINDOW) ret ;;eg caret
;out idChild
if(idChild) ret
int style=GetWinStyle(hwnd); if(style&WS_CHILD) ret

outw hwnd


Forum Jump:


Users browsing this thread: 1 Guest(s)