Jump to content

Get Control handle C# and AutoIt

Recommended Posts

Hi folks,

I'm trying to get control handles from a form in another program I created using C# and the AutoIt library.  I'm able to get the form handle and the get the control class list but then I cannot get the Control handles parsing through the control class list. Ive tried every example I can find yet always fails. Below is a snippet of what I'm using:

hWnd = WinGetHandle("Form1");




classList = WinGetClassList("Form1");

sControls = classList.Split('\n');

sCurrentClass = sControls[0];

// all is good to here!!!

// below are the things I have tried to get a ctrl handle including the actual ctrl ID using spy

hControl = ControlGetHandle(hWnd, "", "[CLASS:" + sCurrentClass + "; " + "INSTANCE:1]");

hControl = ControlGetHandle(hWnd, "", "[CLASSNN:" + sCurrentClass + iCurrentCount + "]");

hControl = ControlGetHandle(hWnd, "Form1", "523560");

hControl = ControlGetHandle(hWnd, "", "[CLASS:STATIC; " + "INSTANCE:1]");


Thanks in advance for any assistance!!!

Link to post
Share on other sites
  • 4 months later...

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...