- Сообщения
- 5,379
- Репутация
- 2,724
Простой способ сворачивания окна в область уведомлений (Tray).
Код:
#NoTrayIcon
#Include <Constants.au3>
#Include <GUIConstantsEx.au3>
Opt('TrayMenuMode', 1)
$TrayRestoreItem = TrayCreateItem('Restore')
TrayItemSetState(-1, $TRAY_DEFAULT)
TrayCreateItem('')
$TrayExitItem = TrayCreateItem('Exit')
TraySetClick(8)
$Form = GUICreate('My GUI')
GUISetState()
While 1
$TrayMsg = TrayGetMsg()
Switch $TrayMsg
Case $TrayRestoreItem
GUISetState(@SW_SHOW, $Form)
GUISetState(@SW_RESTORE, $Form)
TraySetState(2)
Case $TrayExitItem
ExitLoop
EndSwitch
$GUIMsg = GUIGetMsg()
Switch $GUIMsg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $GUI_EVENT_MINIMIZE
GUISetState(@SW_HIDE, $Form)
TraySetState(1)
EndSwitch
WEnd