Gooey Posted February 24, 2006 Share Posted February 24, 2006 Hey, I need some help I have this batch file, it can call other files by pressing numbers than enter, well I'd like to make a GUI version so I can click a button and it will load that file, or whatever.. I found this code in examples it's very simple.. it does not work and the images aren't even the ones I want.. I need a template that I can edit so i can click a button and it will e.g. open notepad, another will open a batch file.. or just a little assistance that will lead me in the right direction expandcollapse popup; button buster ; by gui_tex ; #include <GUIConstants.au3> GUICreate("test",240,180) $button1 = GUICtrlCreateButton ("1", 0,0,40,40,$BS_ICON) GUICtrlSetImage (-1, "shell32.dll",5) Opt("GUIOnEventMode", 1) Run("notepad.exe") WinWaitActive("Untitled - Notepad") ; does not work at all!! notepad starts up autmatically, buttons dont do anything $button2 = GUICtrlCreateButton ("2", 40,00,40,40,$BS_ICON) GUICtrlSetImage (-1, "shell32.dll",7) Opt("GUIOnEventMode", 1) Run("C:\Tools\Bat\open.bat") $button3 = GUICtrlCreateButton ("3", 80,00,40,40,$BS_ICON) GUICtrlSetImage (-1, "shell32.dll",22) $button4 = GUICtrlCreateButton ("4", 120,0,40,40,$BS_ICON) GUICtrlSetImage (-1, "shell32.dll",23) $button5 = GUICtrlCreateButton ("5", 160,0,40,40,$BS_ICON) GUICtrlSetImage (-1, "shell32.dll",32) $buttonclose = GUICtrlCreateButton ("close", 200,0,40,40,$BS_ICON) GUICtrlSetImage (-1, "shell32.dll",28) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend GUIDelete() Link to comment Share on other sites More sharing options...
Valuater Posted February 24, 2006 Share Posted February 24, 2006 (edited) Welcome top the Forumstry this.. it has a perfect example and can help you tremendouslyhttp://www.autoitscript.com/forum/index.php?showtopic=21048#8) Edited February 24, 2006 by Valuater Link to comment Share on other sites More sharing options...
eynstyne Posted February 24, 2006 Share Posted February 24, 2006 I think this is what you were looking for... expandcollapse popup#include <GUIConstants.au3> GUICreate("test",240,180) $button1 = GUICtrlCreateButton ("", 0,0,40,40,$BS_ICON) GUICtrlSetImage (-1, "shell32.dll",6) Run("notepad.exe") WinWaitActive("Untitled - Notepad") ; does not work at all!! notepad starts up autmatically, buttons dont do anything $button2 = GUICtrlCreateButton ("", 40,00,40,40,$BS_ICON) GUICtrlSetImage (-1, "shell32.dll",7) $button3 = GUICtrlCreateButton ("", 80,00,40,40,$BS_ICON) GUICtrlSetImage (-1, "shell32.dll",22) $button4 = GUICtrlCreateButton ("", 120,0,40,40,$BS_ICON) GUICtrlSetImage (-1, "shell32.dll",23) $button5 = GUICtrlCreateButton ("", 160,0,40,40,$BS_ICON) GUICtrlSetImage (-1, "shell32.dll",32) $buttonclose = GUICtrlCreateButton ("", 200,0,40,40,$BS_ICON) GUICtrlSetImage (-1, "shell32.dll",28) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE exitloop Case $msg = $button1 msgbox(64,"","This is button 1") Case $msg = $button2 msgbox(64,"","This is button 2. It Will run open.bat") Run("C:\Tools\Bat\open.bat") Case $msg = $button3 msgbox(64,"","This is button 3") Case $msg = $button4 msgbox(64,"","This is button 4") Case $msg = $button5 msgbox(64,"","This is button 5") Case $msg = $buttonclose msgbox(64,"","Goodbye") endselect Wend Hope it works out for you. F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent] Link to comment Share on other sites More sharing options...
Gooey Posted February 25, 2006 Author Share Posted February 25, 2006 Valuater, eynstyne.. thanks for the help!! so far so good. 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