Page 3 of 3 FirstFirst 123
Results 81 to 85 of 85

Thread: Global hooks

  1. #81
    New Member
    Join Date
    Nov 2010
    Posts
    1

    Re: Global hooks

    Hi VBDT,
    its fascinating. I downloaded ya Code cause I thought, I'm to stupid. Seems so. First of all: I use VB.Net 2010 Express under Win7. Well. I opened ya source and started it. Works perfect. I can hook and all. I wrote similar code on my own and it didn't work. Now I took your code and copied it into a classes and stuff under 2010. Well. Guess what. It doesn't work. Can you confirm or perhaps even solve me that riddle?

  2. #82
    New Member
    Join Date
    Jan 2023
    Posts
    3

    Re: Global hooks

    Hi VBDT, thanks a lot for your help! I want the latest version but I don't know how to get there, here is the page when I click "here": http://ww38.code2point.com/Post?id=4

    Please tell me how to get the latest version!
    Thanks again as I am new here!

  3. #83
    New Member
    Join Date
    Jan 2023
    Posts
    3

    Re: Global hooks

    Hi Friends,

    I got that you are using Low level WH_KEYBOARD_LL to hook from the Keyboard,


    Please tell me how to make the same sub InstallHook using WH_KEYBOARD?
    I need to hook from WH_KEYBOARD to combine this with the Raw Input to block the input from special keyboard which i only want to use for my application only, do not want this keyboard works for another application.
    Thanks,

  4. #84
    New Member
    Join Date
    Jan 2023
    Posts
    3

    Re: Global hooks

    Quote Originally Posted by nhanvvqsqn View Post
    Hi Friends,

    I got that you are using Low level WH_KEYBOARD_LL to hook from the Keyboard,


    Please tell me how to make the same sub InstallHook using WH_KEYBOARD?
    I need to hook from WH_KEYBOARD to combine this with the Raw Input to block the input from special keyboard which i only want to use for my application only, do not want this keyboard works for another application.
    Thanks,
    Public Sub InstallHook()
    If Me._state = HookState.Uninstalled Then
    Dim hinstDLL As IntPtr = Runtime.InteropServices.Marshal.GetHINSTANCE( _
    Reflection.Assembly.GetExecutingAssembly().GetModules()(0))
    Me._hKeyboardHook = UnsafeNativeMethods.SetWindowsHookEx( _
    UnsafeNativeMethods.WH_KEYBOARD_LL, Me._keyboardProc, hinstDLL, 0)
    If Me._hKeyboardHook = IntPtr.Zero Then
    'Failed to hook. Throw a HookException
    Dim eCode As Integer = Runtime.InteropServices.Marshal.GetLastWin32Error
    Throw New KeyboardHookException(New System.ComponentModel.Win32Exception(eCode).Message)
    Else
    If Me._state <> HookState.Installed Then
    Me._state = HookState.Installed
    Me.OnStateChanged(New WindowsHook.StateChangedEventArgs(Me._state))
    End If
    End If
    End If
    End Sub

  5. #85
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    844

    Re: Global hooks

    this thread is 14 years old and VBDT didn't came back since 2020....
    The best friend of any programmer is a search engine
    "Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
    “They did not know it was impossible so they did it” (Mark Twain)

Page 3 of 3 FirstFirst 123

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