Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Collecting all window handles
#1
I have 2+ command prompt (cmd.exe) windows open on my desktop. My goal is detect all those windows though their handlers. I tried extended foreach-command with userdefined function but somehow it shows the last cmd.exe window handler.
Macro code:
Code:
Copy      Help
str exename="cmd.exe"
str item coll
foreach item coll.from(myenumhandles(exename))
    out item

and function "myenumhandles" code:
Code:
Copy      Help
function str'ProgExeFile
int handle=win("" "" ProgExeFile)
ret handle
#2
Macro
Code:
Copy      Help
ARRAY(int) a; int i
win "" "" "cmd" 0 0 0 a ;;stores handles of all matching windows to a
;results
for(i 0 a.len)
,out _s.getwintext(a[i])
#3
win "" "" "cmd" 0 0 0 a
gives error "too many parts"
and
a=win("" "" "cmd" 0 0 0)
gives error "type mismatch."
#4
Added in QM 2.2.1.


Forum Jump:


Users browsing this thread: 1 Guest(s)