|
|
|
|
|
Dicas
|
|
Visual Basic (ActiveX/Controles/DLL)
|
|
|
Título da Dica: Tirando Menu Copiar Colar do Controle Textbox
|
|
|
|
Postada em 16/1/2008 por KoRn
esse exemplo aqui mostra como tirar o menu do botao direito do textbox
Adicione dois textbox no formulario (Text1) e (Text2)
No form Load
Private Sub Form_Load() OldWindowProc = SetWindowLong( _ Text1.hWnd, GWL_WNDPROC, _ AddressOf NewWindowProc) End Sub
Num MOdulo***********
Option Explicit
Public OldWindowProc As Long
Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Const GWL_WNDPROC = (-4) Public Const WM_CONTEXTMENU = &H7B
Public Function NewWindowProc(ByVal hWnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long If msg <> WM_CONTEXTMENU Then _ NewWindowProc = CallWindowProc( _ OldWindowProc, hWnd, msg, wParam, _ lParam) End Function
|
|
|
|
|