Jump to content

Winactivate by handle


Recommended Posts

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

Link to comment
Share on other sites

  • Developers

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?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

  • Developers

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))

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 10 years later...

WTF im trying Tofigure out how does autoit can activate a window using Handle and im about 2-3hours figuring out i decided to stop and sleep but i got an i dea lets try to search of winac using handle and boom i found this topic and read carefully what is said and this really help me a lot dammmm thanks guys  and also to Autoit for keeping this kind of topic Open  ❤️ KUDOS guys

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...