locked
How to refresh the foreground window, when the application is in background? RRS feed

  • Question

  • Hello,

    I have a problem : My application is a player which displays some video frames. The problem is before my application looses the focus (WM_KILLFOCUS) and after the new focused window is displayed, sometimes in another thread a frame is displayed over the new window.

    My question is simple : Is it possible to say to the new focused window (for example Phonebook) to update all the screen? 

    For the moment I can see my video frame, and when I press the screen, the focused window appears little by little.

    I hope you can help me, and a function exists for that

    thanks
    Tuesday, June 9, 2009 2:52 PM

Answers

  • Thank you for your reply mal Loth, but it doesn't solve my problem. I have no change.

    The answer is to stop my player when I receive WM_CANCELMODE before WM_KILLFOCUS. At this moment the new screen is not displayed.

    I was testing your solution this morning sorry for my late answer.

    See you!
    • Marked as answer by kikekoikan Wednesday, June 10, 2009 8:40 AM
    Wednesday, June 10, 2009 8:40 AM

All replies

  • You may do the following:

    HWND activeWindow = GetActiveWindow();
    UpdateWindow(activeWindow);

    or

    HWND activeWindow = GetActiveWindow();
    SendMessage(activeWindow, WM_PAINT, GetWindowDC(activeWindow), PRF_CLIENT);
    If You'll find my answer satisfactory or helpful - mark it as answered! Thank You.
    • Proposed as answer by C.E.D Wednesday, June 10, 2009 8:07 AM
    Tuesday, June 9, 2009 4:40 PM
  • Thank you for your reply mal Loth, but it doesn't solve my problem. I have no change.

    The answer is to stop my player when I receive WM_CANCELMODE before WM_KILLFOCUS. At this moment the new screen is not displayed.

    I was testing your solution this morning sorry for my late answer.

    See you!
    • Marked as answer by kikekoikan Wednesday, June 10, 2009 8:40 AM
    Wednesday, June 10, 2009 8:40 AM