kugela
09-19-2000, 12:02 PM
I have been investigating how to use and manipulate icons in the system tray, using, of course, the Shell_NotifyIcon API call. I have come across two examples on the Web that differ mostly in how they capture the callback messages.
The first uses the MouseMove event of the controlling window to capture and process the message. This is kinda weird because it seems that the message is received in the X parameter of the MouseMove function and then needs to be divided by the number of twips per pixel given by the Screen object.
My first question is: Why the heck does this work? OR What the heck is going on here?
In the second example, a function to process messages is defined in a *.bas module and then is used to replace the hook function of the controlling window thru the SetWindowLong API call. This new function checks to see if there is a right-click message. If the message is something else, it calls the old hook function using the CallWindowProc API call and the old function's handle that was saved in a global variable.
Second question: What exactly is a hook function? Could someone please clarify and/or give me more info regarding messaging, etc.
Thanks SO much!
Boycott the "HackSDMI Challenge"!!!
www.eff.org
The first uses the MouseMove event of the controlling window to capture and process the message. This is kinda weird because it seems that the message is received in the X parameter of the MouseMove function and then needs to be divided by the number of twips per pixel given by the Screen object.
My first question is: Why the heck does this work? OR What the heck is going on here?
In the second example, a function to process messages is defined in a *.bas module and then is used to replace the hook function of the controlling window thru the SetWindowLong API call. This new function checks to see if there is a right-click message. If the message is something else, it calls the old hook function using the CallWindowProc API call and the old function's handle that was saved in a global variable.
Second question: What exactly is a hook function? Could someone please clarify and/or give me more info regarding messaging, etc.
Thanks SO much!
Boycott the "HackSDMI Challenge"!!!
www.eff.org