eus_deus
30-11-2013, 20:10
Здравствуйте!
Не нашел в документации такой ответ - есть ли возможность отключить на Input (полях ввода) системное контекстное меню? Ставить свое я на них не буду, мне бы просто убрать системное
madmasles
02-12-2013, 11:18
eus_deus,
Попробуйте сделать примерно так.#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <GUIConstantsEx.au3>
#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <WinAPI.au3>
#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <WindowsConstants.au3>
#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <Constants.au3>
Global (http://www.autoitscript.com/autoit3/docs/keywords.htm#Global) $apPTR[2]
$hGui = GUICreate (http://autoit-script.ru/autoit3_docs/functions/GUICreate.htm)('Test', 400, 200)
$nInput = GUICtrlCreateInput (http://autoit-script.ru/autoit3_docs/functions/GUICtrlCreateInput.htm)('', 10, 20, 380, 20)
$hInput = GUICtrlGetHandle (http://autoit-script.ru/autoit3_docs/functions/GUICtrlGetHandle.htm)($nInput)
$nCheckBox = GUICtrlCreateCheckbox (http://autoit-script.ru/autoit3_docs/functions/GUICtrlCreateCheckbox.htm)('Убрать контекстное меню для Input', 10, 60, 380, 20)
GUICtrlSetState (http://autoit-script.ru/autoit3_docs/functions/GUICtrlSetState.htm)($nCheckBox, $GUI_CHECKED)
$hNoContextMenuInput = DllCallbackRegister (http://autoit-script.ru/autoit3_docs/functions/DllCallbackRegister.htm)('_NoContextMenuInput', 'ptr', 'hwnd;uint;wparam;lparam')
$apPTR[1] = DllCallbackGetPtr (http://autoit-script.ru/autoit3_docs/functions/DllCallbackGetPtr.htm)($hNoContextMenuInput)
$apPTR[0] = _WinAPI_SetWindowLong (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_setwindowlong.htm)($hInput, $GWL_WNDPROC, $apPTR[1])
GUISetState (http://autoit-script.ru/autoit3_docs/functions/GUISetState.htm)()
While (http://www.autoitscript.com/autoit3/docs/keywords.htm#While) 1
Switch (http://www.autoitscript.com/autoit3/docs/keywords.htm#Switch) GUIGetMsg (http://autoit-script.ru/autoit3_docs/functions/GUIGetMsg.htm)()
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $GUI_EVENT_CLOSE
_WinAPI_SetWindowLong (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_setwindowlong.htm)($hInput, $GWL_WNDPROC, $apPTR[0])
DllCallbackFree (http://autoit-script.ru/autoit3_docs/functions/DllCallbackFree.htm)($hNoContextMenuInput)
Exit (http://www.autoitscript.com/autoit3/docs/keywords.htm#Exit)
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $nCheckBox
_WinAPI_SetWindowLong (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_setwindowlong.htm)($hInput, $GWL_WNDPROC, $apPTR)
EndSwitch (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndSwitch)
WEnd (http://www.autoitscript.com/autoit3/docs/keywords.htm#WEnd)
Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _NoContextMenuInput($h_Wnd, $i_Msg, $w_Param, $l_Param)
Switch (http://www.autoitscript.com/autoit3/docs/keywords.htm#Switch) $i_Msg
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $WM_CONTEXTMENU
Switch (http://www.autoitscript.com/autoit3/docs/keywords.htm#Switch) $h_Wnd
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $hInput
Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) 0
EndSwitch (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndSwitch)
EndSwitch (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndSwitch)
Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) [b]_WinAPI_CallWindowProc (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_callwindowproc.htm)($apPTR[0], $h_Wnd, $i_Msg, $w_Param, $l_Param)
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc) ;==>_NoContextMenuInput
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.