Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dual Monitors - window becomes active when mouse is in monit
#2
Code:
Copy      Help
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
Code:
Copy      Help
;/
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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)