Solved

waty only

Posted on 1998-08-10
8
201 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 250 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

808 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