Solved

waty only

Posted on 1998-08-10
8
200 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

896 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now