sakshi Posted May 12, 2010 Share 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? Link to comment Share on other sites More sharing options...
somdcomputerguy Posted May 12, 2010 Share 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. Link to comment Share on other sites More sharing options...
wolf9228 Posted May 12, 2010 Share 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 صرح السماء كان هنا Link to comment Share on other sites More sharing options...
wolf9228 Posted May 12, 2010 Share 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]" صرح السماء كان هنا Link to comment Share on other sites More sharing options...
sakshi Posted May 13, 2010 Author Share Posted May 13, 2010 thanks i got it... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now