tempman 0 Posted January 29, 2011 (edited) If WinWaitActive("[CLASS:WordPadClass]", "") or WinWaitActive("[CLASS:Notepad]", "") Then MsgBox(0, "Now", "You can write") EndIf This work only if WordPad is activate, for Notepad MsgBox doesn't popup... Can this be fixed? Edited January 29, 2011 by tempman Share this post Link to post Share on other sites
JohnOne 1,603 Posted January 29, 2011 (edited) Yes, because its waiting for WordPad to become active first. EDIT: What are you trying to do Edited January 29, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Jos 2,214 Posted January 29, 2011 Try: While 1 If WinActive("[CLASS:WordPadClass]", "") Or WinActive("[CLASS:Notepad]", "") Then ExitLoop Sleep(10) WEnd MsgBox(0, "Now", "You can write") SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
tempman 0 Posted January 31, 2011 Thank you, but when I implement a rest of code it will be one hell of a script with alot of while's... Share this post Link to post Share on other sites
AdmiralAlkex 125 Posted January 31, 2011 Thank you, but when I implement a rest of code it will be one hell of a script with alot of while's... And how do you think WinWaitActive works? If you're using it on multiple places, make it a function. Quick example: Func _ABC($sTitle1, $iTitle2) While 1 If WinActive($sTitle1, "") Or WinActive($iTitle2, "") Then ExitLoop Sleep(10) WEnd EndFunc .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Share this post Link to post Share on other sites
MHz 80 Posted February 1, 2011 You can use the Advanced Window Titles and Text handling shown in the help file. REGEXPCLASS can help make the initial example work if either window class is required using just 1 Win* function.If WinWaitActive("[REGEXPCLASS:WordPadClass|Notepad]") Then MsgBox(0, "Now", "You can write") EndIfThe pipe char "|", acts like the Or operator so it looks for either class of "WordPadClass" or "Notepad". Share this post Link to post Share on other sites