|
-
Apr 17th, 2001, 11:31 PM
#1
Thread Starter
New Member
I'm stuck. I would like to detect the right mouse click in IE and be able to activate certain selections on the popup menu that appears as a result of the right-click. Anyone have any suggestions or code I could use to accomplish this? Any help is appreciated.
-Haze
-
May 15th, 2001, 06:28 PM
#2
New Member
enter GetAsyncKeyState at codehound.com for samples. It is an api call that detects the mouse button. You can pass it VK_RBUTTON. Then you can use GetCursor
'in a timer
If GetAsyncKeyState(VK_RBUTTON) Then
Dim pt As POINTAPI
Dim hwndNow as Long
retVal = GetCursorPos(pt)
hwndNow = WindowFromPoint(pt.x, pt.y)
to determine the handle using WindowFromPoint api call. Then get the class name of that handle using GetClassName and check for "Internet Explorer_Server" (this is the class name for IE's browser object).
Dim sText as string
retVal = GetClassName(hwndNow, sText, 255)
Select Case sText
Case "Internet Explorer_Server"
SendKeys "%V" 'Alt+V to view source
End Select
End If
If the class name matches the coordinates under the cursor, you definitely have IE. You can then use SendKeys to activate any context menu with a shortcut key.
Hope this helps.
Rob
-
May 15th, 2001, 06:59 PM
#3
Originally posted by eformx
You can pass it VK_RBUTTON.
Why don't you just use Vb's Right Mouse Button constant?
vbRightButton
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
|