Jump to content
Sign in to follow this  
Gui

Minimize to Tray whilst in a loop, and continue that loop.

Recommended Posts

Gui

Hey guys, I've tried so many things and functions, and still NO LUCk! I need to know how you can minimize to tray, even inside a loop, and still continue that loop whilst minimized to tray. I have just regular minimizing to tray down, but there's no loop involved. So basically, there will be a loop running. Now during that loop, if a button is pressed 'Minimize to Tray', then it will minimize to tray and still continue the loop.

ex()

#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#NoTrayIcon
#Include <Constants.au3>





Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1)  
Opt("TrayIconHide", 0)

TraySetOnEvent($TRAY_EVENT_PRIMARYUP,"SpecialEvent")


TraySetState()

GUICreate ( GUI SHIT )
$start = GUICtrlCreateButton('start')
$mtray = GUICtrlCreateButton('Minimize to tray')
GuiSetState()

While 1
  $msg = GUIGetMsg()
        Select
              Case $msg = $mtray 
                     TraySetIcon("C:\Documents and Settings\Dell Customer\Desktop\Desktop Items\zeroicon.ico")
            GuiSetState(@SW_HIDE)
                         TraySetState(1); show
                       TraySetToolTip ("Youtube Viewer - Click to Restore.")
           
              Case $msg = $start
                         start()
        EndSelect
Wend

Func start()

   For 1 To 10  ; this the the loop...

                ;bla bla...

                ; Now if minimize to tray button is pressed, it should minimize to tray, and still continue this loop..

   Next
EndFunc

Share this post


Link to post
Share on other sites
whim

You might want to hotkey your minimise to tray code with HotKeySet

HTH,

whim

Edited by whim

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.