Posted by Catur Nugroho | File under :

Autoit Control Get Handle Using C#

Retrieves the internal handle of a control.
ControlGetHandle ( "title", "text", controlID )

Parameters

title The title of the window to access.
text The text of the window to access.
controlID The control to interact with. See Controls.

Return Value

Success: Returns the handle (HWND) value.
Failure: Returns "" (blank string) and sets @error to 1 if no window matches the criteria.

Remarks

This function returns a HWND/Handle value.

Source : Autoit Help Document

Source Code Autoit Control Get Handle in C#



Parameters Required :
Title : [CLASS:Notepad]
Text : ""
Control : Edit1

private void controlGetHandleButton_Click(object sender, EventArgs e)
        {
            //open notepad program
            autoit.Run("notepad.exe", "", 1);

            //wait notepad opened until 10 seconds
            autoit.WinWait("[CLASS:Notepad]", "", 10);

            string strReturnHandle = autoit.ControlGetHandle("[CLASS:Notepad]", "", "Edit1");

            MessageBox.Show("Autoit control get handle return value : " + strReturnHandle);
        }


 Download Full Source Code

0 comments:

Post a Comment