Blame | Last modification | View Log | Download
#NoTrayIcon#include <GUIConstantsEx.au3>#include <SendMessage.au3>#include <WindowsConstants.au3>Local $hGUILocal $iButton, $iControl$hGUI = GUICreate("Demo - by Zedna", 300, 200, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX))$iControl = GUICtrlCreateDummy()$iButton = GUICtrlCreateButton("Maximise/Restore", 10, 10, 120, 35)GUICtrlCreateLabel("F11: Maximise/Restore", 15, 50, 120, 35)GUISetState(@SW_SHOW, $hGUI)Local $aHotKey[1][2] = [["!{F11}", $iControl]]GUISetAccelerators($aHotKey, $hGUI)While 1Switch GUIGetMsg()Case $GUI_EVENT_CLOSEExitCase $iControl, $iButtonMaximize()EndSwitchWEndFunc Maximize()Local Const $SC_MAXIMIZE = 0xF030, $SC_RESTORE = 0xF120Local $sStateIf BitAND(WinGetState($hGUI), 32) = 0 Then ; Not Maximised$sState = $SC_MAXIMIZEGUISetStyle( 0)Else$sState = $SC_RESTOREEndIfReturn _SendMessage($hGUI, $WM_SYSCOMMAND, $sState)EndFunc ;==>Maximiz