Close
Showing results 1 to 10 of 14

Hybrid View

  1. #1

    Default

    All good news, thank you.

    I am still having a serious problem, however, in getting windows to focus properly. Is there a trick to this? For example, this simple hotkey:

    <hotkey a>
    <SendLabel w1>
    <Key a>
    <SendLabel w2>
    <Key F2>
    <Wait 50>
    <Key a>
    <restore>
    What almost always happens is that w2 never gets focus and instead the taskbar flashes a tab for w2 needing attention. Then all the keys which were supposed to go to w2 go to w1 instead. I tried inserting a delay after the first sendlabel but that did not help. The error I am actually getting is "1400 invalid window handle" Though previously I would often see the same problem with an error of "0 Completed successfully"

  2. #2

    Default

    Quote Originally Posted by Vreejack View Post
    What almost always happens is that w2 never gets focus and instead the taskbar flashes a tab for w2 needing attention. Then all the keys which were supposed to go to w2 go to w1 instead. I tried inserting a delay after the first sendlabel but that did not help.
    Thanks for the excellent description of what you're seeing. Here's why this is happening. When HotkeyNet sends a keystroke with SendWin to a background window, the first thing it does is tell the operating system, "Please raise the target window to the foreground." Usually when a background program makes this request (HotkeyNet is in the background), Windows refuses to do it as a matter of design to prevent background programs from taking control of your screen and annoying you. So what the operating system usually does in this situation is blink the task bar icon (as you describe) to alert you so you can decide yourself which program should be in the foreground.

    Normally, when SendWin is working properly, HotkeyNet plays a sort of trick on the operating system to force it to carry out the request. In this case, based on what you describe, the trick isn't working. Delays can't help because the problem isn't caused by time. It's caused by the operating system making a decision to refuse the request.

    Quote Originally Posted by Vreejack View Post
    SOLUTION!

    Everything works perfectly if I use SendWinX instead of SendWin.

    Glad to hear it.
    Last edited by Freddie : 11-23-2012 at 01:16 AM
    �Author of HotkeyNet and Mojo

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •