The Darkness Posted February 14, 2006 Share Posted February 14, 2006 (edited) Okay... here is my problem. I am tring to write a gui for my flash drive that will act as a clickable interface to launch certin programs that I use very often. I have got every thing to where it will work, except for one program.[sql]#region --- GuiBuilder code Start ---; Script generated by AutoBuilder 0.6 Prototype#include <GuiConstants.au3>#NoTrayIconOpt("GUIOnEventMode",1)GuiCreate("Pocket Launch", 410, 68, (@DesktopWidth-405)/2, 0 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)[/sql]$Button_1 = GuiCtrlCreateButton("1", 10, 10, 40, 40,$BS_ICON)GUICtrlSetImage ($Button_1, ".\Pocket Launch\trilliian.ico")GUICtrlSetOnEvent(3, "trillian") [sql]$Button_2 = GuiCtrlCreateButton("2", 60, 10, 40, 40,$BS_ICON)GUICtrlSetImage ($Button_2, ".\Pocket Launch\fox.ico")GuiCtrlSetOnEvent(4, "fox")$Button_3 = GuiCtrlCreateButton("3", 110, 10, 40, 40,$BS_ICON)GUICtrlSetImage ($Button_3, ".\Pocket Launch\office.ico")GuiCtrlSetOnEvent(5, "office")$Button_4 = GuiCtrlCreateButton("4", 160, 10, 40, 40,$BS_ICON)GUICtrlSetImage ($Button_4, ".\Pocket Launch\tools.ico")GuiCtrlSetOnEvent(6, "tools")$Button_5 = GuiCtrlCreateButton("5", 210, 10, 40, 40,$BS_ICON)GUICtrlSetImage ($Button_5, ".\Pocket Launch\ccity.ico")$Button_6 = GuiCtrlCreateButton("6", 260, 10, 40, 40,$BS_ICON)GUICtrlSetImage ($Button_6, ".\Pocket Launch\misc.ico")GuiCtrlSetOnEvent(8, "misc")$Button_7 = GuiCtrlCreateButton("7", 310, 10, 40, 40,$BS_ICON)GUICtrlSetImage ($Button_7, ".\Pocket Launch\game.ico")GuiCtrlSetOnEvent(9, "games")$Button_8 = GuiCtrlCreateButton("8", 360, 10, 40, 40,$BS_ICON)GUICtrlSetImage ($Button_8, ".\Pocket Launch\school.ico")GuiCtrlSetOnEvent(10, "school")$Label_9 = GuiCtrlCreateLabel("Trillian", 10, 50, 40, 20, $SS_CENTER)$Label_10 = GuiCtrlCreateLabel("Fox", 60, 50, 40, 20, $SS_CENTER)$Label_11 = GuiCtrlCreateLabel("Office", 110, 50, 40, 20, $SS_CENTER)$Label_12 = GuiCtrlCreateLabel("Tools", 160, 50, 40, 20, $SS_CENTER)$Label_13 = GuiCtrlCreateLabel("CCity", 210, 50, 40, 20, $SS_CENTER)$Label_14 = GuiCtrlCreateLabel("Misc", 260, 50, 40, 20, $SS_CENTER)$Label_15 = GuiCtrlCreateLabel("Games", 310, 50, 40, 20, $SS_CENTER)$Label_16 = GuiCtrlCreateLabel("School", 360, 50, 40, 20, $SS_CENTER)GUISetOnEvent($GUI_EVENT_CLOSE, "ExitPressed")GuiSetState()While 1 sleep(80) $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelectWEndExit[/sql]func trillian() Run(".\1.) Trillian IM\trillian.exe") ExitEndFunc[sql]Func fox() Run(".\2.) Pocket Fox\PortableFirefox.exe") ExitEndFuncFunc office() Run(".\3.) Pocket Office\PortableOpenOffice.exe") ExitEndFuncFunc tools() run("explorer.exe .\4.) Tools") ExitEndFuncFunc ccity() Run("explorer.exe .\5.) Circuit City") ExitEndFuncFunc misc() Run("explorer.exe .\6.) Misc Programs") ExitEndFuncFunc games() Run("explorer.exe .\7.) Games & Stuff") ExitEndFuncfunc school() Run("explorer.exe .\8.) School Work") ExitEndFuncFunc ExitPressed() ExitEndFunc#endregion --- GuiBuilder generated code End ---[/sql] Edited February 14, 2006 by The Darkness Link to comment Share on other sites More sharing options...
ChrisL Posted February 14, 2006 Share Posted February 14, 2006 try putting the working directory in Run(".\1.) Trillian IM\trillian.exe", "c:\Full path to working directory") [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
The Darkness Posted February 14, 2006 Author Share Posted February 14, 2006 (edited) try putting the working directory in Run(".\1.) Trillian IM\trillian.exe", "c:\Full path to working directory")MAN YOU ARE FREAKIN AWESOME!That worked!. Now if you have the time could you tell me why it worked and should I do it to my other program shortcuts? Edited February 14, 2006 by The Darkness Link to comment Share on other sites More sharing options...
ChrisL Posted February 14, 2006 Share Posted February 14, 2006 MAN YOU ARE FREAKIN AWESOME!That worked!. Now if you have the time could you tell me why it worked and should I do it to my other program shortcuts?Specifying the working directory meant that the ini files were loaded from that specified directory rather than the directory that your original program was running from [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
The Darkness Posted February 14, 2006 Author Share Posted February 14, 2006 Specifying the working directory meant that the ini files were loaded from that specified directory rather than the directory that your original program was running fromAhh thank you so much Link to comment Share on other sites More sharing options...
ChrisL Posted February 14, 2006 Share Posted February 14, 2006 NP [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
The Darkness Posted February 14, 2006 Author Share Posted February 14, 2006 (edited) NP One more thing... is there a way to change the maximize button to do another functon, such as run a program? Edited February 14, 2006 by The Darkness Link to comment Share on other sites More sharing options...
ChrisL Posted February 14, 2006 Share Posted February 14, 2006 One more thing... is there a way to change the maximize button to do another functon, such as run a program? If using gui get msg method this works, Just trying to figure out how you do it with onevent Case $msg = $GUI_EVENT_MAXIMIZE MsgBox (0,"Max","You have maximised the window") [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
ChrisL Posted February 14, 2006 Share Posted February 14, 2006 One more thing... is there a way to change the maximize button to do another functon, such as run a program? This will do it with onEvent GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents") GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents") GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "SpecialEvents") Func SpecialEvents() Select Case @GUI_CTRLID = $GUI_EVENT_CLOSE MsgBox(0, "Close Pressed", "ID=" & @GUI_CTRLID & " WinHandle=" & @GUI_WINHANDLE) Exit Case @GUI_CTRLID = $GUI_EVENT_MINIMIZE MsgBox(0, "Window Minimized", "ID=" & @GUI_CTRLID & " WinHandle=" & @GUI_WINHANDLE) Case @GUI_CTRLID = $GUI_EVENT_RESTORE MsgBox(0, "Window Restored", "ID=" & @GUI_CTRLID & " WinHandle=" & @GUI_WINHANDLE) Case @GUI_CTRLID = $GUI_EVENT_MAXIMIZE MsgBox(0, "Window Maximized", "ID=" & @GUI_CTRLID & " WinHandle=" & @GUI_WINHANDLE) EndSelect EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
The Darkness Posted February 14, 2006 Author Share Posted February 14, 2006 This will do it with onEvent GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents") GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents") GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "SpecialEvents") Func SpecialEvents() Select Case @GUI_CTRLID = $GUI_EVENT_CLOSE MsgBox(0, "Close Pressed", "ID=" & @GUI_CTRLID & " WinHandle=" & @GUI_WINHANDLE) Exit Case @GUI_CTRLID = $GUI_EVENT_MINIMIZE MsgBox(0, "Window Minimized", "ID=" & @GUI_CTRLID & " WinHandle=" & @GUI_WINHANDLE) Case @GUI_CTRLID = $GUI_EVENT_RESTORE MsgBox(0, "Window Restored", "ID=" & @GUI_CTRLID & " WinHandle=" & @GUI_WINHANDLE) Case @GUI_CTRLID = $GUI_EVENT_MAXIMIZE MsgBox(0, "Window Maximized", "ID=" & @GUI_CTRLID & " WinHandle=" & @GUI_WINHANDLE) EndSelect EndFunc thanx for taking the time to help... I'm such a noob at this. Link to comment Share on other sites More sharing options...
blademonkey Posted February 14, 2006 Share Posted February 14, 2006 no, you're not. ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung 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