-
Nov 1st, 2010, 08:59 AM
#81
New Member
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?
-
Jan 16th, 2023, 09:45 PM
#82
New Member
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!
-
Jan 16th, 2023, 10:12 PM
#83
New Member
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,
-
Jan 16th, 2023, 10:13 PM
#84
New Member
Re: Global hooks
Originally Posted by nhanvvqsqn
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
-
Jan 17th, 2023, 04:28 AM
#85
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)
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
|