Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here is my function to wait for a window to appear with a timeout of 3 seconds. If the timeout elapses, an error message is displayed.

WaitForWindow( title, message )
    WinWaitActive, %title%, ,3
    if ErrorLevel
        MsgBox %message%
        return false
    return true

It works for all other windows, except LogExpert

The part of the script that uses it is:

Run, c:\\tools\\logexpert\\logexpert.exe %MyLogFile%, max
WaitForWindow( %MyLogFile%, "No logExpert Window")

It doesn't matter what %MyLogFile% contains. It does not recognize the window.

This, on the other hand, works:

Send ^o
if not WaitForWindow( "Open File", "No Open File Window appeared" )
MsgBox "Worked"

Has anybody had this problem with Autohotkey and LogExpert? Is there a workaround?

share|improve this question
You should probably ask this on Stackoverflow – Jasjeev Singh Feb 14 '13 at 20:24
up vote 1 down vote accepted

Did you set the SetTitleMatchMode at the beginning of the script?
This will allow you to find your %Title% string anywhere inside the windows title of the active window.

SetTitleMatchMode, 2

You can check the title strings with the AutoHotKey Windows Spy (Right click on AutoHotKey icon). Once the AutoHotKey Windows Spy is open, click on your target window to inspect the data from that window.

share|improve this answer
Thank you! That worked. I had used Windows Spy and the text was definitely contained in the caption. Explicitly calling SetTitleMatchMode worked. – Carl Feb 14 '13 at 20:57
Nice to see this resolved! – Robert Ilbrink Feb 14 '13 at 21:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.