Found this example in the AutoHotkey Forum.
The example is too small for the Example Scripts so I have posted it here. I'm not asking for help.
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
AutoItSetOption( "MustDeclareVars", 1 )
;Globals
Global $hGUI, $fGuiRolledUp = 0, $iTitleBarWidth = 150, $iTitleBarHeight = 20, $dllUser32 = DllOpen( "user32.dll" )
MainProgram()
Func MainProgram()
$hGUI = GUICreate( "RollGui", 300, 200, 650, 300, -1, $WS_EX_TOPMOST )
GUICtrlCreateLabel( "", 40, 40, 220, 120, $SS_ETCHEDFRAME )
GUICtrlCreateLabel( "Click outside the window to roll window up to small titlebar." & @CRLF & @CRLF & _
"Move cursor over titlebar to restore window.", 50, 50, 200, 100 )
GUIRegisterMsg( $WM_ACTIVATE, "WM_ACTIVATE" )
GUISetState( @SW_SHOW )
While 1
Local $msg = GUIGetMsg(1)
Switch $msg[1]
Case $hGUI
Switch $msg[0]
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
EndSwitch
If $fGuiRolledUp Then
Sleep( 200 )
Local $mPos = MouseGetPos()
Local $wPos = WinGetPos( $hGUI )
If $mPos[0] > $wPos[0] And $mPos[0] < $wPos[0] + $iTitleBarWidth _
And $mPos[1] > $wPos[1] And $mPos[1] < $wPos[1] + $iTitleBarHeight Then
RollGuiDown( $hGUI )
EndIF
EndIf
WEnd
GUIRegisterMsg( $WM_ACTIVATE, "" )
DllClose( $dllUser32 )
GUIDelete( $hGUI )
Exit
EndFunc
Func WM_ACTIVATE( $hWnd, $Msg, $wParam, $lParam )
Switch $hWnd
Case $hGUI
If Not $wParam Then
If Not $fGuiRolledUp Then
RollGuiUp( $hGUI )
EndIf
EndIf
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc
Func RollGuiUp( $hWnd )
Global $hRollGuiUp
Local $wPos = WinGetPos( $hWnd )
Local $sBarName = WinGetTitle ( $hWnd )
$hRollGuiUp = GUICreate( $sBarName, $iTitleBarWidth, 0, $wPos[0], $wPos[1], BitXOR( $GUI_SS_DEFAULT_GUI, $WS_SYSMENU ), BitOR( $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST ) )
GUISetState( @SW_SHOW )
DllCall( $dllUser32, "int", "AnimateWindow", "hwnd", $hGUI, "int", 200, "long", "0x3000A" )
$fGuiRolledUp = 1
EndFunc
Func RollGuiDown( $hWnd )
Global $hRollGuiUp
DllCall( $dllUser32, "int", "AnimateWindow", "hwnd", $hGUI, "int", 200, "long", "0x20005" )
WinActivate( $hWnd )
GUIDelete( $hRollGuiUp )
$fGuiRolledUp = 0
EndFunc
LarsJ