use function win to find how many windows are open of a certain program
example from qm help
this will find all windows of explorer
you can define it even more to exclude windows but changing win line
example 2. this will find all windows of explorer with classname "CabintetWClass"
and even further
example 3
this will find all windows of explorer named This PC with classname "CabintetWClass"
name - window title.
example from qm help
this will find all windows of explorer
ARRAY(int) a; int i; str sc sn
out "[9]ALL WINDOWS OF"
opt hidden 1
win("" "" "explorer" 0 0 0 a)
out a.len;; number of windows found
for(i 0 a.len)
,sc.getwinclass(a[i])
,sn.getwintext(a[i])
,out "%i '%s' '%s'" a[i] sc sn
you can define it even more to exclude windows but changing win line
example 2. this will find all windows of explorer with classname "CabintetWClass"
ARRAY(int) a; int i; str sc sn
out "[9]ALL WINDOWS OF"
opt hidden 1
win("" "CabinetWClass" "explorer" 0 0 0 a)
out a.len;; number of windows found
for(i 0 a.len)
,sc.getwinclass(a[i])
,sn.getwintext(a[i])
,out "%i '%s' '%s'" a[i] sc sn
and even further
example 3
this will find all windows of explorer named This PC with classname "CabintetWClass"
ARRAY(int) a; int i; str sc sn
out "[9]ALL WINDOWS OF"
opt hidden 1
win("This PC" "CabinetWClass" "explorer" 0 0 0 a)
out a.len;; number of windows found
for(i 0 a.len)
,sc.getwinclass(a[i])
,sn.getwintext(a[i])
,out "%i '%s' '%s'" a[i] sc sn
[b]int win($text [$class_] [$exename] [flags] [$prop] [matchindex|ARRAY(int)&a]) ;;`Finds window.` flags: 1 use *, 2 insens., 4 main, 8 popup, 16 list, 32 exename is owner w., 0x200 regexp, 0x400 visible.[/b]
name - window title.
- By default, name can be partial and must match case.
- Empty string ("") matches any name.
- Must be full or with wildcard characters (*?). Case insensitive.
- Default: "" (any).
- Before QM 2.3.4, to use wildcard characters, need flag 0x800.
- You can see class name in QM status bar.
- Filename (e.g., "NOTEPAD") or full path (e.g., "$system$\notepad.exe").
- QM 2.2.0. Process id.