CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Posts
    3

    A question about window's focus !

    Hello.I have a question about the window's focus. Now I want to make a window
    never have the focus, at least it never has the keyboard input focus. You know,
    when we do a mouse click on the window, it will have the focus, that is not the situation I wished. Anyone knows how to solve it, pls tell me. Thanks!!!

    I have tried OnActive() and OnActiveApp() method, but it seems not work.In the two functions I also used SetForegroundWindow() to restore the focus to the original window. It doesn't work. Because the handle of the original focus window is always NULL. Is there sth wrong with what i do? Or Is there any other method? Pls tell me. Thanks a lot!!!

  2. #2
    Join Date
    Apr 2002
    Location
    St.Petersburg, Russia
    Posts
    714

    Re: A question about window's focus !

    Take a look to OnSetFocus() handler. It has a parameter - pointer to the CWnd, that previosly had focus. If this pointer is not null - you can call it's SetFocus() function.
    With best wishes, Alexander Hritonenkov

  3. #3
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: A question about window's focus !

    Why are you posting the same question multiple times? That will not help anybody including you since one thread does not know about other.

    See answers in this one.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured