How can I catch the Mouse Click?
-
Hello everyone, I have created a BHO using C#. The code works fine. I would like to detect mouse click on a particular bytton. The following is the SiteSet().
public class BHO : IObjectWithSite { private SHDocVw.WebBrowser webBrowser; private mshtml.HTMLDocument document; private mshtml.IHTMLDocument2 document2; private mshtml.HTMLElementEvents_Event events; public int SetSite(object site) { if (site != null) { webBrowser = (SHDocVw.WebBrowser)site; webBrowser.DocumentComplete += new SHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler(this.OnDocumentComplete); webBrowser.BeforeNavigate2 += new SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHandler(this.OnBeforeNavigate2); webBrowser.OnQuit += new SHDocVw.DWebBrowserEvents2_OnQuitEventHandler(this.OnQuit); webBrowser.NavigateComplete2 += new SHDocVw.DWebBrowserEvents2_NavigateComplete2EventHandler(this.NavigateComplete2); events.onclick += new mshtml.HTMLElementEvents_onclickEventHandler(this.OnElementMouseClick); }
for the OnElementMouseClick function I have the following.public bool OnElementMouseClick() { MessageBox.Show("HelloWorld..."); return true; } . . . .
But nothing really happens! Am I wrong to think that the above code should give me HelloWorld message once a button is click? Any information on this would be appriciated. Thank you very much. Khoramdin -
Hello everyone, I have created a BHO using C#. The code works fine. I would like to detect mouse click on a particular bytton. The following is the SiteSet().
public class BHO : IObjectWithSite { private SHDocVw.WebBrowser webBrowser; private mshtml.HTMLDocument document; private mshtml.IHTMLDocument2 document2; private mshtml.HTMLElementEvents_Event events; public int SetSite(object site) { if (site != null) { webBrowser = (SHDocVw.WebBrowser)site; webBrowser.DocumentComplete += new SHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler(this.OnDocumentComplete); webBrowser.BeforeNavigate2 += new SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHandler(this.OnBeforeNavigate2); webBrowser.OnQuit += new SHDocVw.DWebBrowserEvents2_OnQuitEventHandler(this.OnQuit); webBrowser.NavigateComplete2 += new SHDocVw.DWebBrowserEvents2_NavigateComplete2EventHandler(this.NavigateComplete2); events.onclick += new mshtml.HTMLElementEvents_onclickEventHandler(this.OnElementMouseClick); }
for the OnElementMouseClick function I have the following.public bool OnElementMouseClick() { MessageBox.Show("HelloWorld..."); return true; } . . . .
But nothing really happens! Am I wrong to think that the above code should give me HelloWorld message once a button is click? Any information on this would be appriciated. Thank you very much. Khoramdinhttp://www.codeproject.com/script/comments/forums.asp?msg=2323846&forumid=1649&mode=all&userid=3018268#xx2323846xx[^] Khoramdin wrote: I surly can stop and take my postings and problems to another forum Guess you didn't do this. You are persistent, but that won't help when you are so far over your head.
only two letters away from being an asset
-
http://www.codeproject.com/script/comments/forums.asp?msg=2323846&forumid=1649&mode=all&userid=3018268#xx2323846xx[^] Khoramdin wrote: I surly can stop and take my postings and problems to another forum Guess you didn't do this. You are persistent, but that won't help when you are so far over your head.
only two letters away from being an asset
Hello, You should POST the entire message rather than posting one section of it. If I remeber correctly, I said "If my messages bother you so much I surly can stop and take my postings and problems to another forum.". That is if you wish to be fare, mate! I still stand by my posting as I am not here to upset anyone. By the way, didn't take your advise and managed to solve the problem. Hey, not all of use get Free MVP title! *wink* Thank you for the reply. Khoramdin
-
Hello, You should POST the entire message rather than posting one section of it. If I remeber correctly, I said "If my messages bother you so much I surly can stop and take my postings and problems to another forum.". That is if you wish to be fare, mate! I still stand by my posting as I am not here to upset anyone. By the way, didn't take your advise and managed to solve the problem. Hey, not all of use get Free MVP title! *wink* Thank you for the reply. Khoramdin
Khoramdin wrote:
You should POST the entire message
You mean like the like above the reference?
Khoramdin wrote:
By the way, didn't take your advise and managed to solve the problem.
Good for you. It is helpful to others to post the solution. If indeed you have solved it yourself. Perhaps someone with more experience just finished it for you. "wink* ;P
only two letters away from being an asset
-
Khoramdin wrote:
You should POST the entire message
You mean like the like above the reference?
Khoramdin wrote:
By the way, didn't take your advise and managed to solve the problem.
Good for you. It is helpful to others to post the solution. If indeed you have solved it yourself. Perhaps someone with more experience just finished it for you. "wink* ;P
only two letters away from being an asset
ha ha ha... I wish someone had solved it for me, mate! I truly cracked my head on that BHO and believe me when I tell you that I was so excited when it got working! I cannot deny the fact that I read nearly a milliion posting and articles before I managed to get it up and running. I am actually thinking of creating a STEP BY STEP and detailed tutorial and submit it to codeproject regarding the BHO. My finding was that, expect one or two articles; there isn't much of information on BHO on Internet. It is good to see you have a delightful sense of humor. Happy thanx-giving, mate.:rose: Khoramdin