- Сообщения
- 5,379
- Репутация
- 2,724
Метод выключения системного меню для окна (иконка в верхнем левом углу окна).
Код:
#Include <WindowsConstants.au3>
#Include <GUIConstantsEx.au3>
Global Const $SC_KEYMENU = 0xF100
$hForm = GUICreate('MyGUI')
GUIRegisterMsg($WM_NCLBUTTONDBLCLK, 'WM_NCLBUTTONDBLCLK')
GUIRegisterMsg($WM_NCLBUTTONDOWN, 'WM_NCLBUTTONDOWN')
GUIRegisterMsg($WM_NCRBUTTONDOWN, 'WM_NCRBUTTONDOWN')
GUIRegisterMsg($WM_SYSCOMMAND, 'WM_SYSCOMMAND')
GUISetState()
Do
Until GUIGetMsg() = -3
Func WM_NCLBUTTONDBLCLK($hWnd, $iMsg, $wParam, $lParam)
Switch $wParam
Case 0x03
Return 0
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NCLBUTTONDBLCLK
Func WM_NCLBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam)
Switch $wParam
Case 0x03
Return 0
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NCLBUTTONDOWN
Func WM_NCRBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam)
Switch $wParam
Case 0x02, 0x03, 0x08, 0x09, 0x14, 0x15
Return 0
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NCRBUTTONDOWN
Func WM_SYSCOMMAND($hWnd, $iMsg, $wParam, $lParam)
Switch $wParam
Case $SC_KEYMENU
Return 0
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_SYSCOMMAND