Jump to content
Sign in to follow this  
KurogamineNox

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

Share this post


Link to post
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.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...