Results 1 to 6 of 6

Thread: [solved] how to do global mouse hook in VB .NET?

  1. #1

    Thread Starter
    Hyperactive Member temp_12000's Avatar
    Join Date
    Jan 2004
    Location
    LA, USA
    Posts
    411

    [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.
    Last edited by temp_12000; Feb 2nd, 2004 at 01:38 PM.



  2. #2
    Frenzied Member
    Join Date
    May 2003
    Location
    So Cal
    Posts
    1,564

  3. #3
    Addicted Member Sheppe's Avatar
    Join Date
    Sep 2002
    Location
    Kelowna, BC
    Posts
    245

    Re: how to do global mouse hook in VB .NET?

    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
    [vbcode]
    On Error Goto Hell
    [/vbcode]
    Sheppe Pharis, MCSD
    Check out http://www.vb-faq.com
    Click here for access to the free Code-Express source code and component sharing network for VB6
    Want a better way to skin your .NET applications? Click here!

  4. #4

    Thread Starter
    Hyperactive Member temp_12000's Avatar
    Join Date
    Jan 2004
    Location
    LA, USA
    Posts
    411

    [solved] Re: how to do global mouse hook in VB .NET?

    Originally posted by Sheppe
    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
    thank you very much, in my quick tests, both keyboard & mouse work, no error.



  5. #5

    Thread Starter
    Hyperactive Member temp_12000's Avatar
    Join Date
    Jan 2004
    Location
    LA, USA
    Posts
    411

    Re: Re: how to do global mouse hook in VB .NET?

    Originally posted by Sheppe
    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
    it can get the hook, however, if directinput is used for reading mouse event, the hook can not trap it.



  6. #6
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148
    Also the WH_MOUSE_LL hook works on Windows NT, 2000, XP and 2003 only - it is not in Windows 95, 98 and Me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width