How to set the back color of a child window

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

  • How to set the back color of a child window

    Hi,

    I have created a child window using WM_CreateWindowAsChild and used a callback function to set a background color, but it does not seem to set the background color at all, instead I get some sort of shady green artefact in the background. I don't understand why it does not work.

    Is there a function to set the background of a child window like SetDesktopColor for the desktop window.

    regards

    fifo
  • Hi,

    Unfortunately, there is no such function.

    But you can simply add the following to your callback function:

    C Source Code

    1. case WM_PAINT:
    2. GUI_SetBkColor(GUI_GREEN);
    3. GUI_Clear();
    4. break;


    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.