Descolada / AHK-v2-libraries

Useful libraries for AHK v2
MIT License
94 stars 9 forks source link

WinEvent.ahk - Missing __RequiredHooks key/value? #9

Closed AnthonMS closed 6 months ago

AnthonMS commented 6 months ago

I tried creating a Restore hook but got the error that Restore did not exist in the static __RequiredHooks Map. I simply added it like this to make it work on my end:

    static __RequiredHooks := Map("Show", [this.EVENT_OBJECT_SHOW], "Create", [this.EVENT_OBJECT_CREATE]
        , "Close", [this.EVENT_OBJECT_CREATE, this.EVENT_OBJECT_NAMECHANGE, this.EVENT_OBJECT_DESTROY]
        , "Active", [this.EVENT_SYSTEM_FOREGROUND], "NotActive", [this.EVENT_SYSTEM_FOREGROUND]
        , "Move", [this.EVENT_OBJECT_LOCATIONCHANGE], "MoveStart", [this.EVENT_SYSTEM_MOVESIZESTART]
        , "MoveEnd", [this.EVENT_SYSTEM_MOVESIZEEND], "Minimize", [this.EVENT_SYSTEM_MINIMIZESTART]
        , "Maximize", [this.EVENT_OBJECT_LOCATIONCHANGE]
        , "Restore", [this.EVENT_SYSTEM_MINIMIZEEND])

Another thing: When I try creating a Move hook on the same Window I have created Restore and Minimize hooks, nothing happens and the callback is never called. Edit: No I was just being stupid on the Move Hook part.

Nice assortment of scripts/libraries though! Hope to see this get resolved.

Descolada commented 6 months ago

Thanks for the bug report, it's fixed now :)