Jump to content

Win activate using classes


Recommended Posts

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

Link to comment
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
Link to comment
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]

Link to comment
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]

Link to comment
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]

Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...