NELyon Posted June 4, 2006 Share Posted June 4, 2006 (edited) Heres the basic idea: i need help with this. I have created a GUI with buttons, and i was wondering how to make the buttons execute other autoit codes. EXAMPLE: you click on the button to make your mouse move to 174,607. MouseMove(174,607)oÝ÷ ØÛh©¶iËb½«^§i»¶â±ÉbrG ©Ú*'z¥¦gÍ£+Þ²gê뢼"¶ayÊy«¢+Ø)U%ÉÑÕÑѽ¸ ÅÕ½Ðí±½¥¸ÅÕ½Ðì¤ EDIT 2.0: oooo. its GUICtrlCreateButton EDIT 3.0:::still wont work... Edited June 4, 2006 by codemyster Link to comment Share on other sites More sharing options...
Uten Posted June 4, 2006 Share Posted June 4, 2006 (edited) You know there is a really helpful and well written help file coming with autoit? It has samples like this all over the place #include <GUIConstants.au3> GUICreate("My GUI Button"); will create a dialog box that when displayed is centered Opt("GUICoordMode",2) $Button_1 = GUICtrlCreateButton ("Run Notepad", 10, 30, 100) $Button_2 = GUICtrlCreateButton ( "Button Test", 0, -1) $Button_3 = GUICtrlCreateButton ( "Mouse move", 0, -1) GUISetState () ; will display an dialog box with 2 button ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 Run('Notepad.exe') ; Will Run/Open Notepad Case $msg = $Button_2 MsgBox(0, 'Testing', 'Button 2 was pressed') ; Will demonstrate Button 2 being pressed Case $msg = $Button_3 MouseMove(200,300) EndSelect Wend EDIT: My spelling is kinda shitty these days. Edited June 4, 2006 by Uten Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling 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