how its done(hyperterminal)?

This is a discussion on how its done(hyperterminal)? within the Windows Programming forums, part of the Platform Specific Boards category; Originally Posted by CommonTater Code: // dispatch window messages while (GetMessage(&msg,NULL,0,0) > 0) if (!TranslateAccellerator( GetForegroundWindow() ,hAccellerator,&msg) if(!IsDialogMessage( GetForegroundWindow() ,&msg)) ...

  1. #16
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    612
    Quote Originally Posted by CommonTater View Post
    Code:
        // dispatch window messages
    
        while (GetMessage(&msg,NULL,0,0) > 0)
          if (!TranslateAccellerator(GetForegroundWindow(),hAccellerator,&msg)
            if(!IsDialogMessage(GetForegroundWindow(),&msg))
              { TranslateMessage(&msg);
                 DispatchMessage(&msg); }
    Hmm, I wonder what'll happen if your window isn't the foreground one. Hint, it won't work. Just use the value returned from CreateWindow. You can't fail to receive it, so why eschew it in favour of something incorrect?

  2. #17
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    Quote Originally Posted by stefan63 View Post
    Here i found problem with "Enter" key detection - solution i did : trigger on EN_MAXTEXT notification.
    To get ENTER keys from an edit control the edit must ahve both the ES_MULTILINE and ES_WANTRETURN styles.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #18
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by adeyblue View Post
    Hmm, I wonder what'll happen if your window isn't the foreground one. Hint, it won't work. Just use the value returned from CreateWindow. You can't fail to receive it, so why eschew it in favour of something incorrect?
    It's done that way so that I can use a single dispatcher for all windows in an application...
    Accelerator and Dialog messages should always be directed to the foreground window for tabbing and hotkey activities. If I use MainWind (or similar) in there the dialog actions (tab, space, etc.) only work for one window, not all of them.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21