Using the filter works fine, too. The technique I described came from the Miranda IM scripts which employ hotkeys and event hooking for the chat dialogs. Since more than one such window can be open at a time, I unregister and reregister every time focus moves to another top-level window.

Steve


On 10/20/2010 12:06 PM, J.J. Meddaugh wrote:
I did notice that after all of this, but doesn't leaving the hotkeys in memory pose memory issues, etc? I thought it was a best practice to clean up as much as possible.
J.J> Meddaugh - ATGuys.com
Your Assistive Technology Experts

    ----- Original Message -----
    *From:* Aaron Smith <mailto:[email protected]>
    *To:* [email protected] <mailto:[email protected]>
    *Sent:* Wednesday, October 20, 2010 8:13 AM
    *Subject:* Re: Handling Characters from Within a Dialog

    On 10/19/2010 9:41 PM, J.J. Meddaugh wrote:
    I notice that the selectAll key is unregistered for the
    dialogClosing event which I assume is as the dialog is closing,
    go figure. But what about if the dialog loses focus?
    While you can do what Steve suggestion, there is built-in
    alternative. You'll notice that the third parameter for the
    RegisterHotkey method is FilterBy (Window object or Process object
    to filter the hot key by). In Immed, the line is:

    Set selectAllReg = Keyboard.RegisterHotkey("Control-A",
    "SelectAll", cmdWin.Window)

    That means that Control-A is tied to cmdWin.Window. When that
    window is active, the hot key function. When it's not active (or
    loses focus), that hot key will not function.

    Aaron

--
    Aaron Smith
    Product Support Specialist * Web Development
    GW Micro, Inc. * 725 Airport North Office Park, Fort Wayne, IN 46825
    260-489-3671 * gwmicro.com

    To insure that you receive proper support, please include all past
    correspondence (where applicable), and any relevant information
    pertinent to your situation when submitting a problem report to the GW
    Micro Technical Support Team.


Reply via email to