Jump to content
Sign in to follow this  
netmastro

Winactivate by handle

Recommended Posts

netmastro

Hi,

I' ve to activate one window that has the same title of another window, so i decided to use

the winhandle.

After I found the handle of the window with winlist I made my script :

AutoItSetOption("WinTitleMatchMode", 4)
$handle = "0x0020100"
WinActivate ($handle)

but doesn't works.

Can someone help me ?

Many thanks.

Netmastro

Share this post


Link to post
Share on other sites
Jos

Hi,

I' ve to activate one window that has the same title of another window, so i decided to use

the winhandle.

After I found the handle of the window with winlist I made my script :

AutoItSetOption("WinTitleMatchMode", 4)
$handle = "0x0020100"
WinActivate ($handle)
You are specifying a string as handle.

How did you get the value for the handle?


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
netmastro

You are specifying a string as handle.

How did you get the value for the handle?

I got the value before through this script :

$var = WinList()

For $i = 1 to $var[0][0]
 ; Only display visble windows that have a title
  If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
    MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])
  EndIf
Next

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then
    Return 1
  Else
    Return 0
  EndIf

EndFunc

I know this value change every time the window is opened but this is not important for

me because I never close it.

Why my script is not working ?

Share this post


Link to post
Share on other sites
netmastro

Did you try to change the handle to numeric?

$handle = 0x0020100
Yeah doesn't works because the exadecimal 0x0020100 is transformed in the decimal number 131328.

Any idea ?

Netmastro

Share this post


Link to post
Share on other sites
Jos

Yeah doesn't works because the exadecimal 0x0020100 is transformed in the decimal number 131328.

Any idea ?

Netmastro

and this?:

$handle = "0x0020100"
WinActivate (HWnd($handle))

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Valuater

and this?:

$handle = "0x0020100"
 WinActivate (HWnd($handle))
Jos, If you run the script from above, it will give two windows with the same title, I think he is trying to "activate" the second window that is a hidden MS-OS window.

... after reading his request again, and running that program, I am sure of it!

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
netmastro

and this?:

$handle = "0x0020100"
WinActivate (HWnd($handle))

IS WORKING !!!!!

THANK YOU !!!!

Thanks all for your patience.

Netmastro

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.