Sign in to follow this  
Followers 0
RabidDonkey

Win activate using classes

9 posts in this topic

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

Share this post


Link to post
Share on other sites



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

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

Thanks for the response what do you mean by get a handle to the window once it is open?

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0