08-18-2013, 11:12 PM
3/2 years later ...
Function windowsPerMonitor
Function windowsPerMonitor
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])