Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how many times does same line of text appear in List?
#2
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
Code:
Copy      Help
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" 
Code:
Copy      Help
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" 
Code:
Copy      Help
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
 
Code:
Copy      Help
[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.
class - window class 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.
exename - program. Default: "" (any). Can be:
  • Filename (e.g., "NOTEPAD") or full path (e.g., "$system$\notepad.exe").
  • QM 2.2.0. Process id.


Messages In This Thread
RE: how many times does same line of text appear in List? - by Kevin - 10-09-2020, 10:47 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)