RabidDonkey Posted November 25, 2008 Posted November 25, 2008 I am trying to use win activate to bring a window to the front. It is a window that is part of another program. I am trying to use [Class] to do it but it does not appear to be working. The class name is "#32770" And I think it has something to do with the # sign again. I tired using the X/Y/w/h but i am not sure how to use that i guess or if its even possible with winactivate? WinActivate("[CLASS:#32770]","") Here is some info from AutoIt v3 window info. >>>> Window <<<< Title: xxxxx Class: #32770 Position: 229, 106 Size: 414, 326 Style: 0x14CA00C4 ExStyle: 0x00010101 Handle: 0x000201DA Any help would be greatly appreciated. Thanks Rabid
FireFox Posted November 25, 2008 Posted November 25, 2008 I am trying to use win activate to bring a window to the front. It is a window that is part of another program. I am trying to use [Class] to do it but it does not appear to be working. The class name is "#32770" And I think it has something to do with the # sign again. I tired using the X/Y/w/h but i am not sure how to use that i guess or if its even possible with winactivate? WinActivate("[CLASS:#32770]","") Here is some info from AutoIt v3 window info. >>>> Window <<<< Title: xxxxx Class: #32770 Position: 229, 106 Size: 414, 326 Style: 0x14CA00C4 ExStyle: 0x00010101 Handle: 0x000201DA Any help would be greatly appreciated. Thanks Rabid Hi,if youre telling us about alt+tab window it's special window so it's hard to do something with it
RabidDonkey Posted November 25, 2008 Author Posted November 25, 2008 I am not sure what you mean by alt+tab windows. However I can manupulate the window, click on buttons and such. I just need it to be the active window.
bo8ster Posted November 25, 2008 Posted November 25, 2008 I am not sure what you mean by alt+tab windows. However I can manupulate the window, click on buttons and such. I just need it to be the active window.Get a handle to the window once it is open then put that into WinActivate - simple answer.If really have to use a class, make sure you have WinTitleMatchMode set to 4 - see "Window Titles and Text (Advanced)" in the help. Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]
RabidDonkey Posted November 25, 2008 Author Posted November 25, 2008 Thanks for the response what do you mean by get a handle to the window once it is open?
bo8ster Posted November 26, 2008 Posted November 26, 2008 I assume you open the program at some point, get a handle to the app then. I like to do Global Const $appHandle = WinGetHandle($appName, "") where $appName = xxxxx. One you have the $appHandle you can do WinActivate($appHandle). Having the appHandle is very useful if u are using ControlGetHandle later on. As before, the WinTitleMatchMode is important. Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]
November Posted November 26, 2008 Posted November 26, 2008 Thanks for the response what do you mean by get a handle to the window once it is open?Here is some code to get you understand Opt ("WinTitleMatchMode", 4) $appName = "AutoIt Help" $appHandle = WinGetHandle($appName, "") ConsoleWrite($appHandle & @CRLF) WinActivate($appHandle) Open the AutoIT help file Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font]
PsaltyDS Posted November 26, 2008 Posted November 26, 2008 Here is some code to get you understand Opt ("WinTitleMatchMode", 4) $appName = "AutoIt Help" $appHandle = WinGetHandle($appName, "") ConsoleWrite($appHandle & @CRLF) WinActivate($appHandle) Open the AutoIT help file Cheers Setting the option for WinTitleMatchMode is not required any more in most cases, because the default mode will now recognize either a starting string or an advanced property match (i.e. "Window Title" or "[CLASS:#32770; TITLE:Window Title]"). Back when setting mode 4 might have been required, you would not have needed it anyway for this example, since you only provide "AutoIt Help" as the match string. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
RabidDonkey Posted November 26, 2008 Author Posted November 26, 2008 Thanks for all your help. I was able to get it to work by using the wingethandle, to grab it at the start. It is weird that When i starts I can use that, but if I try and do it later it does not work.
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