#Include <Constants.au3>
#Include <GUIConstantsEx.au3>
#Include <StaticConstants.au3>
#Include <WindowsConstants.au3>
#Include <WinAPI.au3>
$hForm = GUICreate('MyGUI', 350, 63)
$start = GUICtrlCreateButton('',0, 0, 100, 40)
GUICtrlCreateLabel('Rec.', 0, 0, 100, 40, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont(-1, 12, 600, -1, 'Comic Sans MS')
GUICtrlSetColor(-1, 0xFF0000)
$hDll = DllCallbackRegister('_WinProc', 'ptr', 'hwnd;uint;wparam;lparam')
$pDll = DllCallbackGetPtr($hDll)
$hProc = _WinAPI_SetWindowLong(GUICtrlGetHandle($start), $GWL_WNDPROC, $pDll)
GUISetState()
While 1
$Msg = GUIGetMsg()
Switch $Msg
Case -3
ExitLoop
Case $start
MsgBox(0, 'Сообщение', 'Нажата красивая кнопка "Rec"', 0, $hForm)
EndSwitch
WEnd
_WinAPI_SetWindowLong(GUICtrlGetHandle($start), $GWL_WNDPROC, $hProc)
DllCallbackFree($hDll)
Func _WinProc($hWnd, $iMsg, $wParam, $lParam)
Switch $iMsg
Case $WM_PAINT
Local $tRECT = DllStructCreate($tagRECT)
Local $Ret = DllCall('user32.dll', 'int', 'GetUpdateRect', 'hwnd', $hWnd, 'ptr', DllStructGetPtr($tRECT), 'int', 1)
If $Ret[0] Then
_WinAPI_InvalidateRect(GUICtrlGetHandle(_WinAPI_GetDlgCtrlID($hWnd) + 1), $tRECT)
EndIf
EndSwitch
Return _WinAPI_CallWindowProc($hProc, $hWnd, $iMsg, $wParam, $lParam)
EndFunc ;==>_WinProc