how to set a window as "active"?

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • how to set a window as "active"?

    Hi
    I'm facing an issue with a window created with WM_CreateWindowAsChild.
    Window creation is done during the WM_INIT_DIALOG of my appli widget (which is a FrameWindow widget)
    I'm able to hide or show the window without any issue.
    But I want redraw the window at regular date. With a timer I send a message WM_PAINT to this window.
    Message is well received in the callback, but my GUI command redraw into background, not into my window!
    I don't understand what I should do in order to redraw only my window.
    any idea?
    regards
    André
  • Hi André,

    If you want to redraw a window/widget you should invalidate it. This can be achieved by WM_InvalidateWindow(hWin) where 'hWin' is a handle to the window which should be redrawn. Next time a GUI_Delay() or GUI_Exec() is called, the window gets redrawn.

    In your case you should simply call WM_InvalidateWindow(hWin) when the timer expires.

    Regards,
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi André,

    Yes, you are right.

    Regards,
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.