sakshi 0 Posted May 12, 2010 I am automating a task in which a window is active after the processing is done another window gets active with the same title.and the text in this window keeps changing so the issue is how to detect this window is active or not?it has a different classname so could that help to detect it if its the active window?i.e. how to dtect a window active using title and classname? Share this post Link to post Share on other sites
somdcomputerguy 103 Posted May 12, 2010 You can use the classname in place of the title. Window Titles and Text (Advanced) - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Share this post Link to post Share on other sites
wolf9228 65 Posted May 12, 2010 I am automating a task in which a window is active after the processing is done another window gets active with the same title. and the text in this window keeps changing so the issue is how to detect this window is active or not? it has a different classname so could that help to detect it if its the active window? i.e. how to dtect a window active using title and classname? #include <WinAPI.au3> HotKeySet("{ESC}", "Terminate") Run("Notepad.exe", "", @SW_MAXIMIZE) While 1 TrayTip("RT",IsActiveWindow("[CLASS:Notepad]"),10) Sleep(100) WEnd Func IsActiveWindow($Class) $hWnd1 = _WinAPI_GetForegroundWindow() $hWnd2 = WinGetHandle ($Class, "") if $hWnd1 == $hWnd2 Then Return True Return False EndFunc Func Terminate() Exit 0 EndFunc صرح السماء كان هنا Share this post Link to post Share on other sites
wolf9228 65 Posted May 12, 2010 WINDOW1 = "[CLASS:Notepad;INSTANCE:1]" WINDOW2 = "[CLASS:Notepad;INSTANCE:2]" WINDOW3 = "[CLASS:Notepad;INSTANCE:3]" WINDOW4 = "[CLASS:Notepad;INSTANCE:4]" WINDOW1 = "[CLASS:Notepad;INSTANCE:1]" WINDOW2 = "[CLASS:Notepad;INSTANCE:2]" WINDOW3 = "[CLASS:Notepad;INSTANCE:3]" WINDOW4 = "[CLASS:Notepad;INSTANCE:4]" صرح السماء كان هنا Share this post Link to post Share on other sites