Jump to content

Minimize To Icon


Recommended Posts

Is this what you mean?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
Opt ("TrayMenuMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 300, 300)
GUISetState(@SW_SHOW)
$restore = TrayCreateItem("Restore window")
TrayCreateItem("")
$exititem = TrayCreateItem("Exit")
TraySetState()
While 1
        $Tmsg = TrayGetMsg()
    $GMsg = GUIGetMsg()
    Select
        Case $GMsg  = $GUI_EVENT_CLOSE 
                Exit
        Case $GMsg = $GUI_EVENT_MINIMIZE
        GUISetState(@SW_HIDE,$Form1)
        Case $Tmsg = 0
            ContinueLoop
        Case $Tmsg = $TRAY_EVENT_PRIMARYDOUBLE
            Restore()
        Case $Tmsg = $exititem
            ExitLoop
            
    EndSelect
        
WEnd

Func Restore()
  GUISetState(@SW_SHOW)
  GUISetState(@SW_RESTORE)
EndFunc
Link to comment
Share on other sites

Is this what you mean?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
Opt ("TrayMenuMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 300, 300)
GUISetState(@SW_SHOW)
$restore = TrayCreateItem("Restore window")
TrayCreateItem("")
$exititem = TrayCreateItem("Exit")
TraySetState()
While 1
        $Tmsg = TrayGetMsg()
    $GMsg = GUIGetMsg()
    Select
        Case $GMsg  = $GUI_EVENT_CLOSE 
                Exit
        Case $GMsg = $GUI_EVENT_MINIMIZE
        GUISetState(@SW_HIDE,$Form1)
        Case $Tmsg = 0
            ContinueLoop
        Case $Tmsg = $TRAY_EVENT_PRIMARYDOUBLE
            Restore()
        Case $Tmsg = $exititem
            ExitLoop
            
    EndSelect
        
WEnd

Func Restore()
  GUISetState(@SW_SHOW)
  GUISetState(@SW_RESTORE)
EndFunc

It worked, thanks.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...