Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cannot find a window
#1
Hi

I`m creating macro for my accounting program, i work on a terminal online. Everything would be fine except sometimes a window appears that wants me to approve my actions and i can`t get macro to identify this window. When i record or use find window i get the main window program instead of the one that pops up. I`d like my macro to check if the window appears and click accept, else follow the normal routine.

All quickmacros tools recognize this window as("Terminals" "WindowsForms10.Window.8.app.0.378734a") but it`s just the main window.

Please advise


Attached Files Image(s)
   
#2
I suspect it may be child window. Try to drag it out of the main window. If it is child window, the part of it that does not overlap with the main window will be invisible. If it is child window, use function child() or id() instead of win().
#3
OK, i just installed QM on remote computer. I guess QM doesnt reconize windows well when working on remote desktop.

I have one more question, how to reconize window whith the same handle but completly diferent meaning? i have the same window pop up but the content and actions are different. to check for the first win pop up i used ifa, for the second i just used scan (print scrn first). I wondered if there is another solution, like reconize buton with spec action or sth.
#4
2 Windows can not have the same handle, they can have the same name in that case you can use...

Code:
Copy      Help
int hwnd=win("Untitled - Notepad" "Notepad");; now you can control this window with hwnd
clo hwnd;; example

or search the forum for.
Code:
Copy      Help
GetWindowList

a window trigger off of one of the windows children may also work along with this.

int hwnd=val(_command)
#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"
#6

Very nice, Gintaras. Confusedhock:


Forum Jump:


Users browsing this thread: 3 Guest(s)