#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $hSplash = _SplashTextOnEx("Пример", "Кликните средней кнопкой мыши и это окно закроется", _
800, 600, -1, -1, "Tahoma", 10, 800, 0, -1, BitOR($WS_CAPTION, $WS_POPUP))
GUIRegisterMsg($WM_MBUTTONUP, "WM_MBUTTONUP")
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
_SplashOffEx($hSplash)
MsgBox(0,"", "Окно закрылось.")
Exit
EndSwitch
WEnd
Func WM_MBUTTONUP($hWndGUI, $MsgID, $WParam, $LParam)
If $hWndGUI = $hSplash Then
WinClose($hSplash)
EndIf
EndFunc
Func _SplashTextOnEx($sTitle, $sText, $iW=800, $iH=600, $iX=-1, $iY=-1, $sFntName=-1, $iFntSz=-1, $iFntWd=-1, $iFntAtrb=0, $nFntClr=-1, $nStyle=-1, $nExStyle=-1, $hParent=0)
If IsHWnd($hParent) Then
GUISetState(@SW_DISABLE, $hParent)
EndIf
Local $hSplash = GUICreate($sTitle, $iW, $iH, $iX, $iY, $nStyle, $nExStyle, $hParent)
GUISetBkColor(0xFFFFFF, $hSplash)
Local $nLabel = GUICtrlCreateLabel($sText, 10, ($iH/2)-15, $iW-20, $iH, $SS_CENTER)
GUICtrlSetFont($nLabel, $iFntSz, $iFntWd, $iFntAtrb, $sFntName)
GUICtrlSetColor($nLabel, $nFntClr)
GUICtrlSetState($nLabel, $GUI_DISABLE)
Local $nStatusLabel = GUICtrlCreateLabel("", 0, 5, $iW, 15, $SS_CENTER)
GUICtrlSetFont($nStatusLabel, 8, 800, 4, "Tahoma")
GUICtrlSetColor($nStatusLabel, 0x757575)
GUICtrlSetState($nStatusLabel, $GUI_DISABLE)
GUISetState(@SW_SHOW, $hSplash)
Return $hSplash
EndFunc
Func _SplashTextSetText($hSplash, $sText, $sTitle = -1, $sCtrlClass = "Static1")
ControlSetText($hSplash, "", $sCtrlClass, $sText)
If $sTitle <> -1 Then
WinSetTitle($hSplash, "", $sTitle)
EndIf
EndFunc
Func _SplashOffEx($hSplash, $hParent = 0)
If IsHWnd($hParent) Then
GUISetState(@SW_ENABLE, $hParent)
EndIf
Return GUIDelete($hSplash)
EndFunc