Silvinho Posted November 21, 2007 Share Posted November 21, 2007 How to catch the ID of a Tedit object dynamically, store in a variable and to pass as argument in function ControlClick ("My Window", "", 254) thanks Link to comment Share on other sites More sharing options...
zfisherdrums Posted November 21, 2007 Share Posted November 21, 2007 Hello Silvinho, Someone gave me this a while back: Func GetControlID( $hwnd) Local $ID = DllCall('user32.dll', 'int', 'GetDlgCtrlID', 'hwnd', $hwnd) if IsArray ($ID) Then Return $ID[0] Return 0 EndFunc Is that what you need? Zach... Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... Link to comment Share on other sites More sharing options...
Silvinho Posted November 21, 2007 Author Share Posted November 21, 2007 How to catch the iD of a Tedit Object and to pass as argument in the function ControlClick ("My Window", "", 254) This ID always changes, I need take it and to pass in the function above in a variable. Hello Silvinho, Someone gave me this a while back: Func GetControlID( $hwnd) Local $ID = DllCall('user32.dll', 'int', 'GetDlgCtrlID', 'hwnd', $hwnd) if IsArray ($ID) Then Return $ID[0] Return 0 EndFunc Is that what you need? Zach... Link to comment Share on other sites More sharing options...
zfisherdrums Posted November 21, 2007 Share Posted November 21, 2007 Here's how to use it: Func GetControlID( $hwnd) Local $ID = DllCall('user32.dll', 'int', 'GetDlgCtrlID', 'hwnd', $hwnd) if IsArray ($ID) Then Return $ID[0] Return 0 EndFunc Run ("calc.exe" ) WinWait( "Calculator" ) $hwnd = ControlGetHandle( "Calculator", "", "[TEXT:2]" ) $id = GetControlID( $hwnd ); <---- this gets the control ID of the "2" button ControlClick ("Calculator", "", $id ) Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... Link to comment Share on other sites More sharing options...
Silvinho Posted November 21, 2007 Author Share Posted November 21, 2007 Brother, you are the best Thank you very much Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now