[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

waty only

Posted on 1998-08-10
8
Medium Priority
?
213 Views
Last Modified: 2010-04-30
Hello waty

I am very interesred in  2 questions you answered here.

1)global right mouse click disable, that can be turned on   and off from my app.
2)"a sample project implementing a task manager"

I am hopeing you will e-mail me both these solutions
My project is being held up, and I think you can
help me. My email is hbdevice@netcom.ca

 
Ive posted the original amount of points for both
questions 150+100.
   

0
Comment
Question by:harryq
  • 5
  • 2
8 Comments
 
LVL 14

Accepted Solution

by:
waty earned 1000 total points
ID: 1468507
I have send you the mail.

0
 
LVL 7

Expert Comment

by:kamall
ID: 1468508
waty,
I am also interested in the first question (about the right mouse button). I checked your history and couldnt find that qustion.
Can you please refere me to the question number?
0
 

Author Comment

by:harryq
ID: 1468509
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:harryq
ID: 1468510
kamall
It seems I was thinking of your answer when I composed my question.
http://www.experts-exchange.com/topics/comp/lang/visualbasic/Q.10066315
Can you help me with global right mouse intercept
that can be enabled and disabled from my app?
If so, Ill post you a question for 200 points.


0
 

Author Comment

by:harryq
ID: 1468511
waty, thanks, Ill leave this open while I play with
the "task manager"
0
 

Author Comment

by:harryq
ID: 1468512
waty, thanks, Ill leave this open while I play with
the "task manager"
0
 
LVL 14

Expert Comment

by:waty
ID: 1468513
Here is some code to disable the right click in the web browser.
I think, with some little modifications, you should be able to do what you want

'****************************************************************
'Windows API/Global Declarations for :Disable Right Mouse click
'****************************************************************

'Declarations for Preventing Right-Click in WebBrowser Contr
'     ol:

Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA"
       (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal
       dwThreadId As Long) As Long

Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long)
       As Long

Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal
       nCode As Long, ByVal wParam As Long, lparam As Any) As Long

Declare Function GetCurrentThreadId Lib "kernel32" () As Long

Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal
       hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As
       Long
       Public Const WM_RBUTTONUP = &H205
       Public Const WH_MOUSE = 7

Type POINTAPI
       x As Long
       y As Long
End Type


Type MOUSEHOOKSTRUCT
       pt As POINTAPI
       hwnd As Long
       wHitTestCode As Long
       dwExtraInfo As Long
End Type

Public l_hMouseHook As Long






'****************************************************************
' Name: Disable Right Mouse click
' Description:Disable Right Mouse click in the web browser c
'     ontrol.
' Inputs:None
' Returns:None
' Assumes:None
' Side Effects:None
'****************************************************************


Public Function MouseHookProc(ByVal nCode As Long, ByVal wParam As Long,

       mhs As MOUSEHOOKSTRUCT) As Long
       '     'Prevent Right-Mouse Clicks in WebBrowser Control:

              If (nCode >= 0 And wParam = WM_RBUTTONUP) Then
                     Dim sClassName As String
                     Dim sTestClass As String
                     sTestClass = "HTML_Internet Explorer"
                     sClassName = String$(256, 0)

                            If GetClassName(mhs.hwnd, sClassName, Len(sClassName)) > 0 Then

                                          If Left$(sClassName, Len(sTestClass)) = sTestClass Then
                                                 MouseHookProc = 1
                                                 Exit Function
                                          End If

                            End If

              End If

       MouseHookProc = CallNextHookEx(l_hMouseHook, nCode, wParam, mhs)
End Function


Public Sub BeginRightMouseTrap()

       '     'Start Trapping Right-Mouse clicks in WebBrowser Control:
       l_hMouseHook = SetWindowsHookEx(WH_MOUSE, AddressOf MouseHookProc,
       App.hInstance, GetCurrentThreadId)
End Sub


Public Sub EndRightMouseTrap()

       '     'End Trapping Right-Mouse clicks in WebBrowser Control:
       UnhookWindowsHookEx l_hMouseHook
End Sub

'///////////////////////////////////////////////////////////
'     ///////////
Then add this code to your form:

Private Sub Form_Load()

       BeginRightMouseTrap      
End Sub


Private Sub Form_Unload(Cancel As Integer)

EndRightMouseTrap

End Sub


Private Function MouseHookProc(ByVal nCode As Long, ByVal wParam As

       Long, mhs As MOUSEHOOKSTRUCT) As Long
       '     'Prevent Right-Click in WebBrowser Control:

              If (nCode >= 0 And wParam = WM_RBUTTONUP) Then
                     Dim sClassName As String
                     Dim sTestClass As String
                     sTestClass = "HTML_Internet Explorer"
                     sClassName = String$(256, 0)

                            If GetClassName(mhs.hwnd, sClassName, Len(sClassName)) > 0 Then

                                          If Left$(sClassName, Len(sTestClass)) = sTestClass Then
                                                 MouseHookProc = 1
                                                 Exit Function
                                          End If

                            End If

              End If

       MouseHookProc = CallNextHookEx(l_hMouseHook, nCode, wParam, mhs)
End Function

0
 

Author Comment

by:harryq
ID: 1468514
Thanks Waty, I'm still tweaking but Ill close
the question.
 
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month18 days, 21 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question