#include <GUIConstantsEx.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
Global $apPTR[2]
$hGui = GUICreate('Test', 400, 200)
$nInput = GUICtrlCreateInput('', 10, 20, 380, 20)
$hInput = GUICtrlGetHandle($nInput)
$nCheckBox = GUICtrlCreateCheckbox('Убрать контекстное меню для Input', 10, 60, 380, 20)
GUICtrlSetState($nCheckBox, $GUI_CHECKED)
$hNoContextMenuInput = DllCallbackRegister('_NoContextMenuInput', 'ptr', 'hwnd;uint;wparam;lparam')
$apPTR[1] = DllCallbackGetPtr($hNoContextMenuInput)
$apPTR[0] = _WinAPI_SetWindowLong($hInput, $GWL_WNDPROC, $apPTR[1])
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
_WinAPI_SetWindowLong($hInput, $GWL_WNDPROC, $apPTR[0])
DllCallbackFree($hNoContextMenuInput)
Exit
Case $nCheckBox
_WinAPI_SetWindowLong($hInput, $GWL_WNDPROC, $apPTR[BitAND(GUICtrlRead($nCheckBox), $GUI_CHECKED)])
EndSwitch
WEnd
Func _NoContextMenuInput($h_Wnd, $i_Msg, $w_Param, $l_Param)
Switch $i_Msg
Case $WM_CONTEXTMENU
Switch $h_Wnd
Case $hInput
Return 0
EndSwitch
EndSwitch
Return _WinAPI_CallWindowProc($apPTR[0], $h_Wnd, $i_Msg, $w_Param, $l_Param)
EndFunc ;==>_NoContextMenuInput