[solved] how to do global mouse hook in VB .NET?
Looks like .NET does not support global system hook. I got an example of system wide disable mouse: http://www.devcity.net/forums/faq.as...15&cat=Windows, it works in XP Pro. However, if I only disable some of the mouse event, i.e. LButtomUp and LButtonDown only, then sometimes I got error. What's the difference between disable all mouse events and some of them? Anyone has a better way to do this in VB .NET?
I'm doing a program in VB6 which runs great, however, I want to change it to VB .NET, then I found MS VB .NET does not support global mouse hook, what should I do now? Stay at VB6?
thanks.
Re: how to do global mouse hook in VB .NET?
Quote:
Originally posted by temp_12000
Looks like .NET does not support global system hook. I got an example of system wide disable mouse: http://www.devcity.net/forums/faq.as...15&cat=Windows, it works in XP Pro. However, if I only disable some of the mouse event, i.e. LButtomUp and LButtonDown only, then sometimes I got error. What's the difference between disable all mouse events and some of them? Anyone has a better way to do this in VB .NET?
I'm doing a program in VB6 which runs great, however, I want to change it to VB .NET, then I found MS VB .NET does not support global mouse hook, what should I do now? Stay at VB6?
thanks.
It turns out that it can be done. Here is an article a fellow wrote on how to do it.
http://groups.google.com/groups?q=vi...zum.com&rnum=2
[solved] Re: how to do global mouse hook in VB .NET?
thank you very much, in my quick tests, both keyboard & mouse work, no error.
Re: Re: how to do global mouse hook in VB .NET?
it can get the hook, however, if directinput is used for reading mouse event, the hook can not trap it.