Jump to content

Windows Handle Help

Recommended Posts


Dear Autoit Gurus and helpers,


      I am having a vast amount of trouble with acquiring windows handle as I want to make a automation that I can use in my brother's computer too. Thank you all for reading!


So I figured out how to use controlclick command but cannot get it to work on advanced mode where title or class cannot be used.

>>>> Window <<<<
Title:  Ener
Class:  URPC
Position:   -8, -8
Size:   1382, 744
Style:  0x15CF8000
ExStyle:    0x00000100
Handle: 0x000503EC

>>>> Control <<<<
Class:  AfxWnd70s
Instance:   6
ClassnameNN:    AfxWnd70s6
Advanced (Class):   [CLASS:AfxWnd70s; INSTANCE:6]
ID: 1222
Position:   3, 346
Size:   229, 338
ControlClick Coords:    126, 22
Style:  0x50000000
ExStyle:    0x00000000
Handle: 0x000503C6

>>>> Mouse <<<<
Position:   137, 398
Cursor ID:  0
Color:  0x313280

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
For Help, press F1
Menu bar
Online Window
Online Window
Offline Window

>>>> Hidden Text <<<<


I tried this first on Notepad so I understand how to do this with a simple program first and found that how the syntax comes in the Autoit V3 Window Info is not how to make it work.

The autoit advanced mode window was: Advanced (Class):    [CLASS:Edit; INSTANCE:1]

But this is not worked. What worked instead was:  ControlClick("Untitled - Notepad", "", "Edit1" , "left" , 1 , 67 , 7 ) .... Just an FYI. I do understand it can be done either way, I think.


So bottom line: I am trying to make control click happen without using the title or class. I want to use  Instance and ID or class nn and instance ? Am I doing this wrong ?

How would this line go: $wh1 = WinGetHandle ( " [ CLASS:URPC;Instance:    6] " )  ?????

Info:   ControlClick ( "title", "text", controlID [, button = "left" [, clicks = 1 [, x [, y]]]] ) 


Thank you all









Edited by redhotchillisfan

Share this post

Link to post
Share on other sites

You can use ControlClick function with these parameters;

1. Title.- The title of the window which the control resides. But you can use handle of the window too.

2. Text - Not required. You can use an empty string.

3. ControlID - ID of the control you want to automate. You can use class and instance like this "[CLASS:Button;Instance:1]" 

Hope this helps.

Edit; In this case you can use contol click function like this

Local $Window_Handle = WinGetHandle("Ener")
ControlClick($Window_Handle, "", 1222)


Edited by kcvinu

My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)


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


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.