|
-
Aug 25th, 2003, 01:59 AM
#1
Thread Starter
Fanatic Member
right mouse click on textbox
when I click on a textbox with my right mousebutton I get a little menu(with undo, copy, pasten etc). I do not want to see this menu. I just want that some code is excecuted on right mouse click. is there any way to hide this menu?
- Use the thread tools to Mark your Thread as Resolved when your question is answered.
- Please Rate my answers if they where helpful.
-
Aug 25th, 2003, 02:06 AM
#2
Fanatic Member
you could try doing a SetFocus but you will probably get the menu flash for a split second if it worked.
On the code where it says the RightMouseClick, put
TextBox1.SetFocus and see if it takes he menu away.
then put ur code for ur right mouse click after it. good luck
-
Aug 25th, 2003, 05:51 AM
#3
-= B u g S l a y e r =-
VB Code:
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLong& Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong 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
Const GWL_WNDPROC = (-4)
Const WM_RBUTTONDOWN = &H204
Global WndProcOld As Long
Public Function WindProc(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If wMsg = WM_RBUTTONDOWN Then Exit Function
WindProc = CallWindowProc(WndProcOld&, hwnd&, wMsg&, wParam&, lParam&)
End Function
Sub SubClassWnd(hwnd As Long)
WndProcOld& = SetWindowLong(hwnd, GWL_WNDPROC, AddressOf WindProc)
End Sub
Sub UnSubclassWnd(hwnd As Long)
SetWindowLong hwnd, GWL_WNDPROC, WndProcOld&
WndProcOld& = 0
End Sub
'Add To a Form With a TextBox (called Text1)
Private Sub Form_Load()
SubClassWnd Text1.hwnd
End Sub
Private Sub Form_Unload(Cancel As Integer)
UnSubclassWnd Text1.hwnd
End Sub
picked this up somewhere... not sure where though...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|