pcjunki Posted July 18, 2012 Share Posted July 18, 2012 so i have this little gui that launches office programs. now i wanna make it more "pretty" like have a icon or jpg of the application on the button. but i don't know where to begin on this here's my code.... #include <GUIConstants.au3> #NoTrayIcon #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Micro$oft Office", 213, 156, 238, 148) $Word = GUICtrlCreateButton("Word", 0, 0, 105, 73) $Excel = GUICtrlCreateButton("Excel", 101, -1, 105, 73) $PowerPoint = GUICtrlCreateButton("Powerpoint", 0, 72, 105, 73) $outlook = GUICtrlCreateButton("outlook", 101, 72, 105, 73) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Word Run("C:\Program Files\Microsoft Office\Office12\winword.exe") Exit Case $Excel Run("C:\Program Files\Microsoft Office\Office12\excel.exe") Exit Case $PowerPoint Run("C:\Program Files\Microsoft Office\Office12\POWERPNT.EXE") Exit Case $outlook Run("C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE") Exit EndSwitch WEnd Link to comment Share on other sites More sharing options...
rvn Posted July 18, 2012 Share Posted July 18, 2012 GUICtrlCreatePic in help file Link to comment Share on other sites More sharing options...
Danyfirex Posted July 18, 2012 Share Posted July 18, 2012 look this example. expandcollapse popup#include #include _Main() Func _Main() Local $button1, $button2, $button3, $button4 Local $button5, $buttonclose GUICreate("test", 240, 180) $button1 = GUICtrlCreateButton("1", 0, 0, 40, 40, $BS_ICON) GUICtrlSetImage(-1, "shell32.dll", 5) $button2 = GUICtrlCreateButton("2", 40, 00, 40, 40, $BS_ICON) GUICtrlSetImage(-1, "shell32.dll", 7) $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 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $button1 ; Case $button2 ; Case $button3 ; Case $button4 ; Case $button5 ; Case $buttonclose ExitLoop Case Else EndSwitch WEnd GUIDelete() EndFunc ;==>_Main Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Zedna Posted July 18, 2012 Share Posted July 18, 2012 (edited) You may look at my Resources UDF. Edited July 18, 2012 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search 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