|
-
January 31st, 2000, 01:54 AM
#1
Webbrowser Mouse Event
Hi all,
Do You know how to detect mouse click or not on webbrowser control? Or how to simulate mouse click? Any idea is appreciated. Thanks.
NiteStone
-
January 31st, 2000, 03:22 AM
#2
Re: Webbrowser Mouse Event
to trap the click event on an HTML document that resides in a Web browser control, try this
option Explicit
private withevents d as HTMLDocument
private Sub Command1_Click()
w.Navigate "http://yourURLgoeshere"
End Sub
private Function d_onclick() as Boolean
MsgBox "clicked"
End Function
private Sub w_NavigateComplete2(byval pDisp as _
Object, URL as Variant)
set d = w.Document
End Sub
This might break in many cases, e.g. framesets.
to simulate a mouseclick, try the mouse_event API or SendInput.
-
January 31st, 2000, 05:15 AM
#3
Re: Webbrowser Mouse Event
Thanks for the reply. I have tried it and got an error: user-defined type not defined" on HTMLDocument. I am using VB5. Is HTMLDocument only available in VB6?
NiteStone
-
January 31st, 2000, 05:43 AM
#4
Re: Webbrowser Mouse Event
no, it's not.
You need to add a reference to your vb project "Microsoft HTML Object Library"
-
January 31st, 2000, 06:28 AM
#5
Re: Webbrowser Mouse Event
Thanks again for the reply. Truelly appreciate this. 
I have looked "reference" under project manu yet unable to find "Microsoft HTML object library". Please tell me where to find it?
NiteStone
-
January 31st, 2000, 07:01 AM
#6
Re: Webbrowser Mouse Event
see if you can find an MSHTML.TLB in your system32 directory. Add that to the references.
Do you have access to IE 4 or 5? AFAIK that Typelib comes with IE.
-
January 31st, 2000, 08:03 AM
#7
Re: Webbrowser Mouse Event
Yeah, I have found the library file and added to the project. The codes works great. Thanks million times!! 
NiteStone
I used IE4. Not update to IE5 yet.
-
February 17th, 2000, 03:39 AM
#8
Re: Webbrowser Mouse Event
What is W
Is it a HTMLwindow?
-
February 17th, 2000, 03:59 AM
#9
Re: Webbrowser Mouse Event
No, "w" is the name of the WebBrowser Control that I placed on the form.
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
|