0

Edit: If anyone's tried this in win32 before, am I going in the right direction by using DrawThemeBackground()?

I'v recently enabled Visual Styles using a manifest for version 6 of ComCtl32.dll. Example of Visual Styles in Win32: Visual Styles

The buttons look great, but I can't figure out how to make the background around the buttons transparent. Please see example image: http://www.freeimagehosting.net/image.php?2bdeff33ba.jpg

My main window background color is set to dark grey with:

a.hbrBackground = GetStockObject(DKGRAY_BRUSH);

The common controls are initialized with:

INITCOMMONCONTROLSEX stylesStruct;
stylesStruct.dwSize = sizeof(stylesStruct);
stylesStruct.dwICC = ICC_STANDARD_CLASSES;
InitCommonControlsEx(&stylesStruct);

And I create the button windows with:

j = CreateWindow(L"BUTTON", L"hello",
    WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 100, 100,
    100, 100, h, 0, hInst, 0);

Buttons look fine over a white background, but the border becomes visible over anything else. Is it possible to make the border around buttons transparent?

tyler
  • 167
  • 1
  • 2
  • 8
  • It sounds like you still didn't get the answer you were looking for here, even though you accepted it. I [provided an answer to a similar question](http://stackoverflow.com/questions/4483599/transparent-background-of-xp-themed-control/4551951#4551951) that was asked more recently; see if that's not what you're looking for. – Cody Gray - on strike Mar 30 '11 at 03:11

1 Answers1

1

Have you tried WS_EX_TRANSPARENT?

I think you can set it in the resource editor in Visual Studio, if you're using that.

Peter
  • 7,216
  • 2
  • 34
  • 46
  • Thanks, that does help (the boarder is thinner). But there's still a thin black border around the button. Do you know if there's a way to fill that with the background color? – tyler May 12 '09 at 04:18