Jump to content
Sign in to follow this  
sigmason

GUIRegisterMsg Scope?

Recommended Posts

sigmason

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.

Share this post


Link to post
Share on other sites
Zedna

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 function

function parameter: The name of the user function to call when the message appears or an empty string "" to unregister a message.

  Edited by Zedna

Share this post


Link to post
Share on other sites
sigmason

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 function

Thanks, 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 by sigmason

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.