sigmason Posted August 29, 2007 Share Posted August 29, 2007 I'm new to this command in AutoIt. I've used this to hook the WM_ERASEBKGND method of a window. I notice it doesn't specify a window or control. What is the scope of this hook, is it hooking the event globally including outside AutoIt windows, is it confined to all AutoIt windows only or only certain windows (if so how does one know which ones?) How does one undo the hook once created? Is there a command that will remove the call to the function we inject or do we just skip our injected code and return to $GUI_RUNDEFMSG if we want to stop hooking that call to the method? Thanks for your support and patience. Link to comment Share on other sites More sharing options...
Zedna Posted August 29, 2007 Share Posted August 29, 2007 (edited) It's all in AutoIt helpfile (also look at example there):- it is confined to all AutoIt windows only - for that script (you can distinguish more GUIs by hWnd param)Func MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam) - undo the hook: call GUIRegisterMsg ( msgID, "function" ) without functionfunction parameter: The name of the user function to call when the message appears or an empty string "" to unregister a message. Edited August 29, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
sigmason Posted August 29, 2007 Author Share Posted August 29, 2007 (edited) It's all in AutoIt helpfile (also look at example there):- it is confined to all AutoIt windows only - for that script (you can distinguish more GUIs by hWnd param) - undo the hook: call GUIRegisterMsg ( msgID, "function" ) without functionThanks, for some reason I read that section of the help file several times and didn't notice the unhook comment in the parameters table or contemplate the value of the parameter passed in determining at what level the hook was operating.That said, I guess you determined that the return is to $GUI_RUNDEFMSG means that the only default handler would have been part of AutoIt?Thanks and sorry, that should have been a simple RTFM, but it just wasn't clicking. Perhaps a few lines in the remark with all the other notes would have made it more obvious. Edited August 30, 2007 by sigmason Link to comment Share on other sites More sharing options...
Zedna Posted August 30, 2007 Share Posted August 30, 2007 Thanks and sorry, that should have been a simple RTFM, but it just wasn't clicking. Perhaps a few lines in the remark with all the other notes would have made it more obvious.No problem. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
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