Jump to content

need help with controlID


jsteng
 Share

Recommended Posts

using this example script as reference:

#include <MsgBoxConstants.au3>

Example()

Func Example()
    ; Run Notepad
    Run("notepad.exe")

    ; Wait 10 seconds for the Notepad window to appear.
    Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)

    ; Set the edit control in Notepad with some text. The handle returned by WinWait is used for the "title" parameter of ControlSetText.
    ControlSetText($hWnd, "", "Edit1", "This is some text")

    ; Retrieve the text of the edit control in Notepad. The handle returned by WinWait is used for the "title" parameter of ControlGetText.
    Local $sText = ControlGetText($hWnd, "", "Edit1")

    ; Display the text of the edit control.
    MsgBox($MB_SYSTEMMODAL, "", "The text in Edit1 is: " & $sText)

    ; Close the Notepad window using the handle returned by WinWait.
    WinClose($hWnd)
EndFunc   ;==>Example

How do I know "Edit1" is a controlID from Notepad?  What are the other controlID used by Notepad?

To be more specific, How do I get to know controlID used by a specified window handle from WinList()?
 

I hope I expressed my question properly.

many thanks.

 

Link to comment
Share on other sites

@jsteng

The full SCITE editor for AutoIt, as opposed to the Lite version that comes with the AutoIt installer, comes with a set of tools.  One of those tools is AU3Info.  It is very helpful in showing the information you are after.

Here's where the full editor can be downloaded:

https://www.autoitscript.com/site/autoit-script-editor/downloads/

And the screen shot below shows where the tools can be found in the editor:

image.png.4ce048eb82c0fb001d1de8c312336320.png

Once Au3Info is running, just drag the Finder Tool over the window or control of interest to see all of the related info,

image.png.4cd332b724c44efcc7e22f9c1556ad22.png

Edited by TheXman
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...