0

I'm looking for a way to paint my custom controls into both the client and non-client area of a dialog. More or less the white area below

enter image description here

I used DwmExtendFrameIntoClientArea and I managed to get that effect by extending the client area on the entire window with

MARGINS mar = {-1, -1, -1, -1};

DwmExtendFrameIntoClientArea ( hWnd, &mar );

but now every control which I set with a transparent background

SetBkMode(hdc, TRANSPARENT);

have their colors blended with the aero stuff (the same problem you can see here).

Is there a way for the controls to retain their right color and avoid blending with the background?

Dean
  • 6,610
  • 6
  • 40
  • 90

1 Answers1

1

It is because the window treated the black colour as the transparency key.

You just need to set another value:

SetWindowLong(hWnd,GWL_EXSTYLE,WS_EX_LAYERED);
// Choose a colour that you will not use in the program, eg RGB(200,201,202)
SetLayeredWindowAttributes(hWnd,RGB(200,201,202),0,LWA_COLORKEY);
William Chan
  • 277
  • 2
  • 12