Solved

waty only

Posted on 1998-08-10
8
199 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

743 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

10 Experts available now in Live!

Get 1:1 Help Now