Sign in to follow this  
Followers 0
Aprilgogo

WM_KEYUP message in hook.dll

5 posts in this topic

Hi,

I downloaded Larry's hook.dll (thanks Larry!) and runs the MouseHook.au3 script. But the script can't capture the WM_KEYUP message. So I checked the original dll.c code and found:

in function:

LRESULT CALLBACK KeyProc( int nCode, WPARAM wParam, LPARAM lParam

{

......

if (lParam & 0x80000000)

PostMessage(m_hHwndKey, AU3_WM_KEYDOWN, wParam, iState);

else

{

PostMessage(m_hHwndKey, AU3_WM_KEYDOWN, wParam, iState);

}

......

}

I think one of the red part should be AU3_WM_KEYUP. One can also check the behavior of the MouseHook.au3: when a key is pressed and released, two identical message shows in the tooltip.

Could someone please:

1. I download hook.dll in some part of the forum (sorry I forgot the link). If there is a correct version of hook.dll, could you please tell me the link?

2. I don't have a MS VC++ installed. If there is not a correct version of hook.dll, could you please build one and provide the link?

3. Is it possible to implement dll.c in AutoIt3 script?

Thank you, guys!

Share this post


Link to post
Share on other sites



Hi Larry,

Thanks for the reply. But what I mean is the WM_KEYUP typo, not the WM_MOUSEWHEELUP typo.

Anyway, I found a VC++ machine, corrected the code and posted here:

http://www.autoitscript.com/forum/index.ph...=53215&st=0

Could you please recompile the code and provide the fixed dll in your original post? Thank you!

BTW, I tested some keys on my keyboard and found that the script did not get a WM_KEYDOWN message when the "PrintScreen" is pressed but got a WM_KEYUP message when "PrintScreen" is released. Why does this happen?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hi Larry,

Thanks for the reply. But what I mean is the WM_KEYUP typo, not the WM_MOUSEWHEELUP typo.

Anyway, I found a VC++ machine, corrected the code and posted here:

http://www.autoitscript.com/forum/index.ph...=53215&st=0

Could you please recompile the code and provide the fixed dll in your original post? Thank you!

BTW, I tested some keys on my keyboard and found that the script did not get a WM_KEYDOWN message when the "PrintScreen" is pressed but got a WM_KEYUP message when "PrintScreen" is released. Why does this happen?

Some keys act funny... When I wrote the scriptwriter I noticed quarkiness with PRINTSCREEN and TAB+MODIFIER and others too I think.

This attachment has been changed to work with the latest PellesC...

Lar.

hook.zip

Edited by LarryDalooza

f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites

Try that zip again... I edited it because the code reversed KeyDown,KeyUp...

Lar


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

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