LithiumLi Posted February 10, 2009 Posted February 10, 2009 (edited) I want to know if I can have tray and GUI in the same while loop. If possible can you please keep it simple since I already have a huge GUI loop and now my friend has decided he wants it also in the tray While 1 $GGM = GUIGetMsg() Switch $GGM $TGM = TrayGetMsg() Select Case $MyGUI _MyGUIFunction() Case $TGM = $MyTray _MyTrayFunction() EndSwitch EndSelect WEnd Thanks Edited February 10, 2009 by LithiumLi
Authenticity Posted February 10, 2009 Posted February 10, 2009 You can use AutoIt's tray for your own needs like new menu items or different icon, or primary mouse double click event upon the tray...
LithiumLi Posted February 10, 2009 Author Posted February 10, 2009 You can use AutoIt's tray for your own needs like new menu items or different icon, or primary mouse double click event upon the tray...I know but how can I have a GUI + Tray in the same while loop
Authenticity Posted February 10, 2009 Posted February 10, 2009 I'd like to suggest using "TrayOnEventMode" or TrayItemSetOnEvent() instead of handling it from within a msg handling loop. If you're insisting to use it within a msg loop you can use the TrayGetMsg() function...
LithiumLi Posted February 10, 2009 Author Posted February 10, 2009 I'd like to suggest using "TrayOnEventMode" or TrayItemSetOnEvent() instead of handling it from within a msg handling loop. If you're insisting to use it within a msg loop you can use the TrayGetMsg() function...I know but can you provide example of using GUI + Tray while/loop please that is what I need.
Authenticity Posted February 10, 2009 Posted February 10, 2009 expandcollapse popupOpt('TrayMenuMode', 1) Dim $hGUI, $bt Dim $Frist, $SecondSub, $Third $hGUI = GUICreate('Title', 400, 385) $bt = GUICtrlCreateButton('Button&1', 170, 177, 60, 30) $Frist = TrayCreateMenu('First') $SecondSub = TrayCreateItem('SecondSub', $Frist) $Third = TrayCreateItem('Third') GUISetState() While 1 Local $msg = GUIGetMsg() Local $tMsg = TrayGetMsg() Switch $msg Case $bt MsgBox(0x40, 'Title', 'Button') Case -3 ExitLoop EndSwitch Switch $tMsg Case $SecondSub MsgBox(0x40, 'Tray', 'SecondSub') Case $Third MsgBox(0x10, 'Tray', 'Third') EndSwitch WEnd GUIDelete($hGUI) Exit
LithiumLi Posted February 10, 2009 Author Posted February 10, 2009 expandcollapse popupOpt('TrayMenuMode', 1) Dim $hGUI, $bt Dim $Frist, $SecondSub, $Third $hGUI = GUICreate('Title', 400, 385) $bt = GUICtrlCreateButton('Button&1', 170, 177, 60, 30) $Frist = TrayCreateMenu('First') $SecondSub = TrayCreateItem('SecondSub', $Frist) $Third = TrayCreateItem('Third') GUISetState() While 1 Local $msg = GUIGetMsg() Local $tMsg = TrayGetMsg() Switch $msg Case $bt MsgBox(0x40, 'Title', 'Button') Case -3 ExitLoop EndSwitch Switch $tMsg Case $SecondSub MsgBox(0x40, 'Tray', 'SecondSub') Case $Third MsgBox(0x10, 'Tray', 'Third') EndSwitch WEnd GUIDelete($hGUI) Exit Thanks very much ill try adding it in my script now
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