Sign in to follow this  
Followers 0
chr

Using WH_KEYBOARD_LL in autoit

4 posts in this topic

I've tried using the example for Mousehook posted by Larry to hook to WH_KEYBOARD_LL with no luck. Using an example VB code from

http://www.codeguru.com/vb/gen/vb_system/k...icle.php/c4831/

How can I provide the address of my function KeyboardCallback to SetWindowsHookEx? Is this even possible to do by using autoit without any helper hook.dll (would like to do this only by scripting)?

thanks,

Share this post


Link to post
Share on other sites



I've tried using the example for Mousehook posted by Larry to hook to WH_KEYBOARD_LL with no luck. Using an example VB code from

http://www.codeguru.com/vb/gen/vb_system/k...icle.php/c4831/

How can I provide the address of my function KeyboardCallback to SetWindowsHookEx? Is this even possible to do by using autoit without any helper hook.dll (would like to do this only by scripting)?

thanks,

all you need is in that post of Larry. Setting a callback function within AU3 is not possible, as you cannot define a pointer to any function, that's why hook.dll is needed.

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

all you need is in that post of Larry. Setting a callback function within AU3 is not possible, as you cannot define a pointer to any function, that's why hook.dll is needed.

But his post is using WH_KEYBOARD not WH_KEYBOARD_LL (lowlevel) My callback handler must return 1 or CallNextHookEx. What does hook.dll export?

Share this post


Link to post
Share on other sites

Maybe instead of trying to get you to understand us and us to understand you...

What are you trying to accomplish?

Lar.

Agree...

Well, I've made a script that locks a common workstation. We need to know who has been using this console thats why we don't use the normal windows lock. By using winlockdll.dll from codeproject I disable task-switching keys and ctrl-alt-del successful. Know my quest is how do I override Win-L to start my lock-script instead of windows lock . Of course doing a hotkeyset on any other not reserved works. By reading the source code of winlockdll and the VB source code (link in my first post) it should be possible to catch all keyboard messages by using hook on WH_KEYBOARD_LL. As I understand the examples I need to return 1 to block key combination, to accept I have to pass the key to the next hook.

Apparently there is no way to make such callback function in autoit without using a helper dll. I don't know the source of your hook.dll and what its capable to do. I'm not to good in c++ to make my own dll. So if you could help me I'd appreciate it...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0