Wait for window to show

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
tomerstern
Posts: 3
Joined: 19 Aug 2020, 14:53

Wait for window to show

Post by tomerstern » 19 Aug 2020, 15:04

Hi guys,
Is it possible for ahk to wait for a window and if it shows up, bring it to the front and then send a key into it?
I know the title starts with "VNC Authentication".

Thanks a lot in advance.

User avatar
boiler
Posts: 17328
Joined: 21 Dec 2014, 02:44

Re: Wait for window to show

Post by boiler » 19 Aug 2020, 15:25

Code: Select all

WinWait, VNC Authentication
WinActivate, VNC Authentication
Send, a ; or whatever you want to send

tomerstern
Posts: 3
Joined: 19 Aug 2020, 14:53

Re: Wait for window to show

Post by tomerstern » 19 Aug 2020, 15:49

Didnt work.
I also tried

Code: Select all

SetTitleMatchMode, 2

WinWaitActive, VNC Authentication
Msgbox, Hello! did it work properly this time?
and

Code: Select all

SetTitleMatchMode, 2

While !WinExist("VNC Authentication")
{
	sleep, 100
}
WinActivate, VNC Authentication
WinWaitActive, VNC Authentication
Msgbox, Hello! did it work properly this time?
None seemed to work.

User avatar
boiler
Posts: 17328
Joined: 21 Dec 2014, 02:44

Re: Wait for window to show

Post by boiler » 19 Aug 2020, 16:09

What does the Window Spy tool say the title of the window is? Try copying and pasting directly from there in case there are any hidden characters or something.

Post Reply

Return to “Ask for Help (v1)”