Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cannot find a window
#5
If QM runs in remote computer, it should recognize windows well. If QM runs in local computer that controls the remote computer, it cannot recognize windows in the remote computer, because in local computer whole remote view is just an image, not windows. That is why your macro finds the window that displays the image.

----


Quote:I have one more question...

Try function WinC.

Or get window handles with GetWindowList, then search for a child window or accessible object or html element in each window.

Let's say there are two "Untitled - Notepad" windows. One contains text "one", another contains text "two". How to find the window that contains "one"?

Using WinC:

Code:
Copy      Help
int h=WinC("one" "Edit" 4 "Untitled - Notepad" "Notepad")

Using GetWindowList:
Code:
Copy      Help
ARRAY(int) aw; int i h
GetWindowList 0 "" 3 0 0 aw
h=0
for i 0 aw.len
,if(!wintest(aw[i] "Untitled - Notepad" "Notepad")) continue
,Acc a=acc("" "TEXT" aw[i] "Edit" "one" 0x1804 0x0 0x20000040)
,err continue ;;the window does not contain object "one"
,h=aw[i]; break

Then:
Code:
Copy      Help
if(h)
,ifa(h) out "active"
,else
,,out "inactive"
,,act h    
else
,out "not found"


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)