WainWaitNotActive not waiting

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AtleastItried
Posts: 51
Joined: 03 Mar 2017, 04:51

WainWaitNotActive not waiting

03 Nov 2017, 13:11

I have the following code that is executed:

Code: Select all

SendInput #+s

ErrorLevel:=0
WinWaitActive,ahk_class Microsoft-Windows-SnipperCaptureForm-WinShiftS,,2
if (ErrorLevel=1)Return
Sleep 100
WinWaitNotActive,ahk_class Microsoft-Windows-SnipperCaptureForm-WinShiftS,,
Run, msPaint.exe
I want it to wait until the snipping thing is gone before proceding, but it goes ahead right away. How can I fix this?
User avatar
TheDewd
Posts: 1513
Joined: 19 Dec 2013, 11:16
Location: USA

Re: WainWaitNotActive not waiting

03 Nov 2017, 13:44

Try WinWaitClose

Code: Select all

SendInput, #+s

IfWinExist, ahk_class Microsoft-Windows-Tablet-SnipperCaptureForm ; If Window Exists
{
    WinWaitClose, ahk_class Microsoft-Windows-Tablet-SnipperCaptureForm ; Wait for Window to Close
}

Sleep, 100

Run, mspaint.exe

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: macromint, peter_ahk, Spawnova and 265 guests