Mike--
Cut and past of the code i am using inside of WinLIFT to skin ListBox and the Combo ListBox part,
the principle is the same with all the GDI32 child controls.
switch (nCtrlType) {
case CTRL_LISTBOX:
case CTRL_COMBOLISTBOX:
if (ListCount(hWnd) > 0) { // To deal with the DWM_AERO mode
if ((nCtrlType = CTRL_LISTBOX) && (skGetSystemMetrics(SK_DWM_AERO))) {
skChildOffset(hWnd, ofX, ofY);
if (wParam == 0) {
BeginPaint(hWnd, &ps); hDC = ps.hdc;
} else {
hDC = (HDC) wParam;
}
hDCmem = skOFFscreen(hDC, Xin, Yin, 1);
CallWindowProc(ChildMessage, WM_PRINTCLIENT, (WPARAM) hDCmem, lParam);
if (GdipCreateFromHDC(hDCmem, graphics) == 0) {
GdipCreateBitmapFromHBITMAP((HBITMAP) GetCurrentObject(hDCmem, OBJ_BITMAP), NULL, img);
GdipDrawImageRectI(graphics, img, 0, 0, Xin, Yin);
if (img) { GdipDisposeImage(img); }
GdipDeleteGraphics(graphics);
}
skOFFscreen(0, 0, 0, 0);
if (wParam == 0) { EndPaint(hWnd, &ps); }
return 0;
} else {
nRet = CallWindowProc(ChildMessage, uMsg, wParam, lParam);
}
} else { // in case of empty ListBox
skChildOffset(hWnd, ofX, ofY);
if (wParam == 0) {
BeginPaint(hWnd, &ps); hDC = ps.hdc; }
else {
hDC = (HDC) wParam;
}
hDCmem = skOFFscreen(hDC, Xin, Yin, 1);
if (nCtrlType == CTRL_LISTBOX) {
skAlphaBlend(hDCmem, 0, 0, Xin, Yin, skGetHdcMemBmp(skPopupOwner(hWnd)), ofX, ofY, Xin, Yin);
skShadowBlt(hDCmem, 0, 0, Xin, Yin, skGetSysColor(SKCOLOR_SHADOW), skGetSystemMetrics(SK_TRANSLUCENCY));
} else { // 4.61 CTRL_COMBOLISTBOX
skFillRect(hDCmem, 0, 0, Xin, Yin, skGetSysColor(SKCOLOR_EDITCOLORBACK));
}
skOFFscreen(0, 0, 0, 0);
if (wParam == 0) { EndPaint(hWnd, &ps); }
return 0;
}
break;