dantay9 Posted June 21, 2009 Posted June 21, 2009 (edited) I do not understand the mouse hook used in my script. I got the hook from another script on the forum. If there is a way to use GUIRegisterMsg instead of the hook, please show me. If not, does anyone have a good tutorial on Hooks?New_AutoIt_v3_Script.au3 Edited June 21, 2009 by dantay9
Authenticity Posted June 21, 2009 Posted June 21, 2009 Read this and this pages carefully, it's pretty much self-explanatory. The hook in the script you've posted is checking if the mouse event is a wheel rotation or a wheel down event. If it's a wheel, the high word of the mouseData member of the structure is either a negative or a positive value of the delta (120 or -120 by default) and I don't good in math to understand the rest . If the mouse wheel is down (clicked) then if the window is visible it's hidden and vice versa.
dantay9 Posted June 21, 2009 Author Posted June 21, 2009 Thanks Authenticity! Do you know if there is a way to use guiregistermsg? If you don't know something off the top of your head, don't bother. What I have works fine.
Authenticity Posted June 21, 2009 Posted June 21, 2009 A hook procedure differs from the window procedure in that it captures event on the system level rather than only your window level. In other words, without reading the script to see why it's using a mouse hook procedure, the program is probably interested to be notified about event posted from the mouse regardless if it's the active window. If you'll use GUIRegisterMsg($WM_MOUSEWHEEL, 'onmousewheel') for example, you're going to be notified only if your window is the active window.
dantay9 Posted June 21, 2009 Author Posted June 21, 2009 Thanks a lot. I understand hooks a lot more now.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now