Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Toggle window to monitor.
#9
3/2 years later ...

Function windowsPerMonitor
Code:
Copy      Help
function [mon]
out
int hwnd hMonitor c1 ;str exe titles
ARRAY(int) handles h_left h_middle h_right
GetWindowList &titles "" 1|2|4 0 0 handles
ARRAY(str) arr = titles

for(c1 0 arr.len) ;; c1 is counter 1
,hwnd=handles[c1]
,hMonitor=MonitorFromWindow(hwnd MONITOR_DEFAULTTONEAREST)
,sel MonitorIndex(hMonitor)
,,case 1 h_right[] = hwnd
,,case 2 h_middle[] = hwnd
,,case 3 h_left[] = hwnd
,,
;out h_left.len
;out h_middle.len
;out h_right.len

for(c1 0 h_left.len)
,out "%s" exe.getwintext(h_left[c1])
,
for(c1 0 h_middle.len)
,out "%s" exe.getwintext(h_middle[c1])
,
for(c1 0 h_right.len)
,out "%s" exe.getwintext(h_right[c1])
pi


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)