rawkhopper Posted February 20, 2019 Share Posted February 20, 2019 Hello Everyone, I use some software for work that only works when attached to the machine. There is not an "offline" version of the software that I have access to. So I was curious if I could create a GUI in AutoIt that had specific Control IDs so that I could experiment with automation when away from the machine. This way I would not have to use customer time to satisfy my own automation needs. For example the software that controls the machine has a Textbox with a control ID of 1001. I can recreate a gui using a snapshot of the background and then creating a textbox in the right location. But I like to use ControlSend so that mouse and keyboard use is less likely to interrupt the automation. So can I set the control ID of my fake textbox to fool my own automation so that I can test it when not in the customer lab? I hope I am making sense. #include <GUIConstantsEx.au3> Global $hGuiWin = GUICreate ( "FakeProgram", 1276, 1015) GUISetBkColor (0xf0f0f0, $hGuiWin ) $FakeTextBox = GUICtrlCreateInput ("", 85, 39, 73,16) #can I set the Control ID to 1001 for this box? GUICtrlCreatePic('C:\Users\MYNAME\Desktop\SCREENSHOT.jpg', 0, 0 ,1276, 1015) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE Exit Link to comment Share on other sites More sharing options...
LarsJ Posted February 20, 2019 Share Posted February 20, 2019 #include <GUIConstantsEx.au3> Global $hGuiWin = GUICreate ( "FakeProgram", 1276, 1015) GUISetBkColor (0xf0f0f0, $hGuiWin ) For $i = 3 To 1000 ; First Control ID = 3 GUICtrlCreateDummy() ; This allocates Control IDs from 3 to 1000 Next ; The next control will get ID = 1001 $FakeTextBox = GUICtrlCreateInput ("", 85, 39, 73,16) ; can I set the Control ID to 1001 for this box? ;GUICtrlCreatePic('C:\Users\MYNAME\Desktop\SCREENSHOT.jpg', 0, 0 ,1276, 1015) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE Exit Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
rawkhopper Posted February 21, 2019 Author Share Posted February 21, 2019 Hmm, that seems to get somewhat complicated creating some of the other buttons especially if I miss on and have to go back and add it later. Thanks for the help. I guess I just have to be careful not to miss one Link to comment Share on other sites More sharing options...
rawkhopper Posted February 21, 2019 Author Share Posted February 21, 2019 Oh and thanks for correcting my # with ; 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