|
-
Apr 12th, 2006, 08:05 AM
#1
Thread Starter
Junior Member
How to dedect if mouse is pressed on Webbrowser?
How to dedect if mouse or key is pressed on Webbrowser?
There's no such thing like Webbrowser1_Click or Webbrowser1_MouseDown
I need to start a countdown timer every time user clicks on the webbrowser
So it'd show idle time or something
-
Apr 12th, 2006, 08:56 AM
#2
Re: How to dedect if mouse is pressed on Webbrowser?
add a reference to the HTML Object library
VB Code:
Dim WithEvents HTMLDOC As HTMLDocument
Private Sub Form_Load()
WebBrowser1.Navigate "www.vbforums.com"
End Sub
Private Function HTMLDOC_onclick() As Boolean
Debug.Print "CLICK!"
End Function
Private Sub HTMLDOC_onmousedown()
Debug.Print "MOUSEDOWN!"
End Sub
Private Sub HTMLDOC_onmouseup()
Debug.Print "MOUSEUP!"
End Sub
Private Function HTMLDOC_onmousewheel() As Boolean
Debug.Print "MOUSEWHEEL!"
End Function
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If Not WebBrowser1.Document Is Nothing Then
Set HTMLDOC = WebBrowser1.Document
End If
End Sub
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Apr 12th, 2006, 03:29 PM
#3
Thread Starter
Junior Member
Re: How to dedect if mouse is pressed on Webbrowser?
It detects it when I create new project and test the code on it.
But if I try the code on my existing project, it won't work.
What could block/interrupt this code?
-
Apr 12th, 2006, 03:31 PM
#4
Re: How to dedect if mouse is pressed on Webbrowser?
actually not sure what would stop it from working?!??
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Apr 13th, 2006, 08:14 AM
#5
Thread Starter
Junior Member
Re: How to dedect if mouse is pressed on Webbrowser?
But is it possible, to create some area with API or something, and detect, if mouse is clicked there?
-
Apr 13th, 2006, 08:20 AM
#6
Re: How to dedect if mouse is pressed on Webbrowser?
 Originally Posted by Sannu
But is it possible, to create some area with API or something, and detect, if mouse is clicked there?
All controls have both a mouse down and click event if that is what you mean.
-
Apr 13th, 2006, 08:23 AM
#7
Re: How to dedect if mouse is pressed on Webbrowser?
actually Hack, the webbrowser control doesnt...
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Apr 13th, 2006, 09:31 AM
#8
Thread Starter
Junior Member
Re: How to dedect if mouse is pressed on Webbrowser?
Yes, that's what i mean..
-
Apr 14th, 2006, 03:51 PM
#9
Thread Starter
Junior Member
Re: How to dedect if mouse is pressed on Webbrowser?
-
Apr 14th, 2006, 04:43 PM
#10
Hyperactive Member
Re: How to dedect if mouse is pressed on Webbrowser?
Well If you want to get all the clicks of all the webbrowser then you have to do like a download software "Reget Delux" does, it installs a .dll as we installs Flash Plugin.
So you have to develop such plugin so you can get what ever happneing at WebBrowser even at iexplore.exe
Regards,
Vishalgiri Goswami
Gujarat, ( INDIA ).
---------------------
-
Apr 15th, 2006, 09:13 AM
#11
Thread Starter
Junior Member
Re: How to dedect if mouse is pressed on Webbrowser?
no you can't just understand
I have a form
I have a wb on it
I want to capture all clicks on webbrowser
-
Apr 19th, 2006, 03:19 PM
#12
Hyperactive Member
Re: How to dedect if mouse is pressed on Webbrowser?
As i told you to do so, you have to make a IE plugin that will capture all clicks and the appropriate function (defined by you) will be called
other Relatively Easy way to accomplish goal is
When ever the page is loded then add some JavaScript Using InnerHTML property than would be like OnClick="Javascript:document.location(sannu://click)
and capture it at navigate event
Regards,
Vishalgiri Goswami
Gujarat, ( INDIA ).
---------------------
-
Apr 19th, 2006, 03:32 PM
#13
Re: How to dedect if mouse is pressed on Webbrowser?
the code I posted should work.. if it worked in its own project.. then something u have going on is stopping it. keep playing.
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Apr 19th, 2006, 03:46 PM
#14
Hyperactive Member
Re: How to dedect if mouse is pressed on Webbrowser?
 Originally Posted by Static
add a reference to the HTML Object library
VB Code:
Dim WithEvents HTMLDOC As HTMLDocument
Private Sub Form_Load()
WebBrowser1.Navigate "www.vbforums.com"
End Sub
Private Function HTMLDOC_onclick() As Boolean
Debug.Print "CLICK!"
End Function
Private Sub HTMLDOC_onmousedown()
Debug.Print "MOUSEDOWN!"
End Sub
Private Sub HTMLDOC_onmouseup()
Debug.Print "MOUSEUP!"
End Sub
Private Function HTMLDOC_onmousewheel() As Boolean
Debug.Print "MOUSEWHEEL!"
End Function
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If Not WebBrowser1.Document Is Nothing Then
Set HTMLDOC = WebBrowser1.Document
End If
End Sub
Ya it is working perfectly...
But if he Wants to do by api he might be asking for Hooking
Regards,
Vishalgiri Goswami
Gujarat, ( INDIA ).
---------------------
-
Apr 20th, 2006, 11:06 AM
#15
Re: How to dedect if mouse is pressed on Webbrowser?
 Originally Posted by Vishalgiri
Ya it is working perfectly...
But if he Wants to do by api he might be asking for Hooking
API is not always the best way
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
|