03-29-2007, 01:42 PM
int mon pmon
rep
,1
,POINT p; xm p
,mon=MonitorFromPoint(p MONITOR_DEFAULTTONULL)
,if(mon=pmon or !mon) continue
,if(pmon)
,,;mouse moved into another monitor
,,;out mon
,,int h=win
,,if(MonitorFromWindow(h MONITOR_DEFAULTTONULL)!=mon and h!=win(mouse))
,,,;out 1
,,,ifk((1)) continue ;;maybe moving a window
,,,h=GetFirstWindowInMonitor(h mon)
,,,if(h) act h
,pmon=mon
,Function GetFirstWindowInMonitor
;/
function# h mon
;Simplified.
rep
,h=GetWindow(h iif(h GW_HWNDNEXT GW_HWNDFIRST)); if(!h) break
,if(MonitorFromWindow(h MONITOR_DEFAULTTONULL)!=mon) continue
,if(!IsWindowVisible(h) or !IsWindowEnabled(h)) continue
,if(GetWindow(h GW_OWNER) or GetWinStyle(h 1)&WS_EX_TOOLWINDOW) continue
,ret h