1
votes

While automating an process in a MDI application, I try to use AutoHotKey.

On a given time, a new mdi child window popups in the MDI application, and I would like to "wait" my autohotkey script until this is opened.

So I was heading for a loop that checks if the control (mdi child) exists.

Using ControlGet, I can't seem to get the mdi child.

This is the child which I would like to know if exists or not.

AutoSpy:

( Now Under Mouse Cursor )

ClassNN: FNWND31101
Text: Phrase Extraction

enter image description here

Perhaps I am not using the correct AutoHotKey function to find this?

Script

WinWait, FNWND31101,, 10
if ErrorLevel
{
  MsgBox, WinWait timed out.
  return
} else 
{
  MsgBox, Found control  
}

enter image description here

1

1 Answers

1
votes

Try using winwait like this:

winwait, FNWND3110

The window has ID: FNWND3110 and the object under the mouse has ID: FNWND31101

Have a look at these URL's:

http://www.autohotkey.com/board/topic/85114-detecting-new-child-window/

http://www.autohotkey.com/board/topic/8398-how-to-winwait-a-mdi-child-window/

And the last argument of MouseGetPos: http://www.autohotkey.com/docs/commands/MouseGetPos.htm

Otherwise, ask at the AHK forum: http://www.autohotkey.com/board/