Subversion Repositories DMV.t01c1

Rev

Blame | Last modification | View Log | Download

#NoTrayIcon 
#include <GUIConstantsEx.au3> 
#include <SendMessage.au3> 
#include <WindowsConstants.au3> 
Local $hGUI 
Local $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 1     
  Switch GUIGetMsg()         
    Case $GUI_EVENT_CLOSE             
      Exit         
    Case $iControl, $iButton             
      Maximize()     
  EndSwitch 
WEnd 

Func Maximize()     
  Local Const $SC_MAXIMIZE = 0xF030, $SC_RESTORE = 0xF120     
  Local $sState     
  
  If BitAND(WinGetState($hGUI), 32) = 0 Then ; Not Maximised         
    $sState = $SC_MAXIMIZE     
    GUISetStyle( 0) 
  Else         
    $sState = $SC_RESTORE     
  EndIf     
Return _SendMessage($hGUI, $WM_SYSCOMMAND, $sState) 
EndFunc   ;==>Maximiz