FinalVersion Posted February 11, 2010 Posted February 11, 2010 (edited) I've already added Opt("TrayAutoPause", 0), all I want now is when I hit the minimize button the program goes to the tray, and when you click the tray icon it comes back up. Edited February 11, 2010 by FinalVersion [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center]
Steveiwonder Posted February 11, 2010 Posted February 11, 2010 Didn't read it but just a quick search and found http://www.autoitscript.com/forum/index.php?showtopic=46793&st=0&p=350174&hl=minize%20to%20tray&fromsearch=1&#entry350174 GL hope it helps. Steve They call me MrRegExpMan
FinalVersion Posted February 11, 2010 Author Posted February 11, 2010 No it didn't thanks anyway [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center]
Steveiwonder Posted February 11, 2010 Posted February 11, 2010 (edited) Hey! Did it... Works for me atleast expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #NoTrayIcon Opt('MustDeclareVars', 1) Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown. local $guiMsg, $trayMsg, $showWindow ;Create GUI GUICreate("My GUI") ; will create a dialog box that when displayed is centered GUISetState(@SW_SHOW) ; will display an empty dialog box ;Create Tray Menu $showWindow = TrayCreateItem("Show Window") While 1 If WinGetState("My GUI") = 23 Then ; 23 = 1 + 2 + 4 + 16 - Exists, Visible, Enabled, Minimized GUISetState(@SW_HIDE) Opt("TrayIconHide", 0) EndIf ; ---- GUI Shizzle $guiMsg = GUIGetMsg() Select Case $guiMsg = $GUI_EVENT_CLOSE ExitLoop EndSelect ; ---- Tray Shizzle $trayMsg = TrayGetMsg() Select Case $trayMsg = $showWindow GUISetState(@SW_SHOW) WinSetState("My GUI", "", @SW_RESTORE) Opt("TrayIconHide", 1) EndSelect WEnd Let me know Edited February 11, 2010 by Steveiwonder They call me MrRegExpMan
Yashied Posted February 11, 2010 Posted February 11, 2010 expandcollapse popup#NoTrayIcon #Include <Constants.au3> #Include <GUIConstantsEx.au3> #Include <WinAPIEx.au3> #Include <WindowsConstants.au3> Opt('MustDeclareVars', 1) Opt('TrayMenuMode', 1) Global Const $SC_MINIMIZE = 0xF020 Global $hTray = ControlGetHandle('[CLASS:Shell_TrayWnd]', '', 'TrayNotifyWnd1') Global $hForm, $GUIMsg, $TrayMsg, $Dummy, $TrayRestoreItem, $TrayExitItem $TrayRestoreItem = TrayCreateItem('Restore') TrayItemSetState(-1, $TRAY_DEFAULT) TrayCreateItem('') $TrayExitItem = TrayCreateItem('Exit') TraySetClick(8) $hForm = GUICreate('My GUI') $Dummy = GUICtrlCreateDummy() GUIRegisterMsg($WM_SYSCOMMAND, 'WM_SYSCOMMAND') GUISetState() While 1 $TrayMsg = TrayGetMsg() Switch $TrayMsg Case $TrayRestoreItem _WinAPI_DrawAnimatedRects($hForm, _WinAPI_GetWindowRect($hTray), _WinAPI_GetWindowRect($hForm)) GUISetState(@SW_SHOW, $hForm) TraySetState(2) Case $TrayExitItem ExitLoop EndSwitch $GUIMsg = GUIGetMsg() Switch $GUIMsg Case $GUI_EVENT_CLOSE _WinAPI_AnimateWindow($hForm, BitOR($AW_BLEND, $AW_HIDE)) ExitLoop Case $Dummy ; Minimize _WinAPI_DrawAnimatedRects($hForm, _WinAPI_GetWindowRect($hForm), _WinAPI_GetWindowRect($hTray)) GUISetState(@SW_HIDE, $hForm) TraySetState(1) EndSwitch WEnd Func WM_SYSCOMMAND($hWnd, $iMsg, $wParam, $lParam) Switch $hWnd Case $hForm Switch $wParam Case $SC_MINIMIZE GUICtrlSendToDummy($Dummy) Return 0 EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_SYSCOMMANDWinAPIEx.au3 My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
FinalVersion Posted February 11, 2010 Author Posted February 11, 2010 @Stevie How could I incorporate it into my current GUI? I took a shot but failed. expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include "Ini.au3" $frmMain = GUICreate("Application QuickStart", 451, 331, 192, 124) $Settings = GUICtrlCreateGroup("Settings", 8, 8, 433, 169) $lblPath = GUICtrlCreateLabel("Path to Executable:", 24, 32, 97, 17) $txtPath = GUICtrlCreateInput("", 24, 56, 201, 21) $lblExe = GUICtrlCreateLabel("Executable:", 296, 32, 60, 17) $lblParams = GUICtrlCreateLabel("Parameters:", 24, 96, 60, 17) $txtParams = GUICtrlCreateInput("", 24, 120, 201, 21) $txtExe = GUICtrlCreateInput("", 296, 56, 113, 21) $lblState = GUICtrlCreateLabel("Window State:", 296, 96, 74, 17) $CState = GUICtrlCreateCombo("", 296, 120, 113, 25) $btnLaunch = GUICtrlCreateButton("Launch", 80, 144, 129, 25, $WS_GROUP) $btnReset = GUICtrlCreateButton("Reset", 240, 144, 129, 25, $WS_GROUP) GUICtrlCreateGroup("", -99, -99, 1, 1) $lstCore = GUICtrlCreateList("", 8, 184, 433, 138) GUICtrlSetFont(-1, $FSize, 400, 0, $Font) GUICtrlSetColor(-1, 0x00FF00) GUICtrlSetBkColor(-1, 0x000000) GUISetState(@SW_SHOW) GUICtrlSetData($txtPath, $DefaultPath) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $btnLaunch Launch() GUICtrlSetData($txtPath, $DefaultPath) Case $btnReset Reset() Cout("Reset Form Data!", $lstCore) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center]
FinalVersion Posted February 11, 2010 Author Posted February 11, 2010 No one? [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center]
Steveiwonder Posted February 11, 2010 Posted February 11, 2010 Sorry for late reply, have been asleep all day (working nights) expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include "Ini.au3" #NoTrayIcon Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown. Local $trayMsg, $showWindow ;Tray stuff $showWindow = TrayCreateItem("Show Window") ;GUI Stuff $guiWinTitle = "Application QuickStart" $frmMain = GUICreate($guiWinTitle, 451, 331, 192, 124) $Settings = GUICtrlCreateGroup("Settings", 8, 8, 433, 169) $lblPath = GUICtrlCreateLabel("Path to Executable:", 24, 32, 97, 17) $txtPath = GUICtrlCreateInput("", 24, 56, 201, 21) $lblExe = GUICtrlCreateLabel("Executable:", 296, 32, 60, 17) $lblParams = GUICtrlCreateLabel("Parameters:", 24, 96, 60, 17) $txtParams = GUICtrlCreateInput("", 24, 120, 201, 21) $txtExe = GUICtrlCreateInput("", 296, 56, 113, 21) $lblState = GUICtrlCreateLabel("Window State:", 296, 96, 74, 17) $CState = GUICtrlCreateCombo("", 296, 120, 113, 25) $btnLaunch = GUICtrlCreateButton("Launch", 80, 144, 129, 25, $WS_GROUP) $btnReset = GUICtrlCreateButton("Reset", 240, 144, 129, 25, $WS_GROUP) GUICtrlCreateGroup("", -99, -99, 1, 1) $lstCore = GUICtrlCreateList("", 8, 184, 433, 138) GUICtrlSetFont(-1, $FSize, 400, 0, $Font) GUICtrlSetColor(-1, 0x00FF00) GUICtrlSetBkColor(-1, 0x000000) GUISetState(@SW_SHOW) GUICtrlSetData($txtPath, $DefaultPath) While 1 If WinGetState($guiWinTitle) = 23 Then ; 23 = 1 + 2 + 4 + 16 - Exists, Visible, Enabled, Minimized GUISetState(@SW_HIDE) Opt("TrayIconHide", 0) EndIf $trayMsg = TrayGetMsg() Select Case $trayMsg = $showWindow GUISetState(@SW_SHOW) WinSetState($guiWinTitle, "", @SW_RESTORE) Opt("TrayIconHide", 1) EndSelect $nMsg = GUIGetMsg() Switch $nMsg Case $btnLaunch Launch() GUICtrlSetData($txtPath, $DefaultPath) Case $btnReset Reset() Cout("Reset Form Data!", $lstCore) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Worked for me. They call me MrRegExpMan
FinalVersion Posted February 11, 2010 Author Posted February 11, 2010 Thanks man, exactly what I wanted. [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center]
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