| 1400 | } |
| 1401 | |
| 1402 | void PaintControl(HWND hWnd, HDC hdc, RECT* prc, bool bDrawBorder) |
| 1403 | { |
| 1404 | HDC hdcPaint = nullptr; |
| 1405 | |
| 1406 | if (bDrawBorder) |
| 1407 | InflateRect(prc, 1, 1); |
| 1408 | HPAINTBUFFER hBufferedPaint = BeginBufferedPaint(hdc, prc, BPBF_TOPDOWNDIB, nullptr, &hdcPaint); |
| 1409 | if (hdcPaint && hBufferedPaint) |
| 1410 | { |
| 1411 | RECT rc; |
| 1412 | GetWindowRect(hWnd, &rc); |
| 1413 | |
| 1414 | PatBlt(hdcPaint, 0, 0, RECTWIDTH(rc), RECTHEIGHT(rc), BLACKNESS); |
| 1415 | BufferedPaintSetAlpha(hBufferedPaint, &rc, 0x00); |
| 1416 | |
| 1417 | /// |
| 1418 | /// first blit white so list ctrls don't look ugly: |
| 1419 | /// |
| 1420 | PatBlt(hdcPaint, 0, 0, RECTWIDTH(rc), RECTHEIGHT(rc), WHITENESS); |
| 1421 | |
| 1422 | if (bDrawBorder) |
| 1423 | InflateRect(prc, -1, -1); |
| 1424 | // Tell the control to paint itself in our memory buffer |
| 1425 | SendMessage(hWnd, WM_PRINTCLIENT, reinterpret_cast<WPARAM>(hdcPaint), PRF_CLIENT | PRF_ERASEBKGND | PRF_NONCLIENT | PRF_CHECKVISIBLE); |
| 1426 | |
| 1427 | if (bDrawBorder) |
| 1428 | { |
| 1429 | InflateRect(prc, 1, 1); |
| 1430 | FrameRect(hdcPaint, prc, static_cast<HBRUSH>(GetStockObject(BLACK_BRUSH))); |
| 1431 | } |
| 1432 | |
| 1433 | // don't make a possible border opaque, only the inner part of the control |
| 1434 | InflateRect(prc, -2, -2); |
| 1435 | // Make every pixel opaque |
| 1436 | BufferedPaintSetAlpha(hBufferedPaint, prc, 255); |
| 1437 | EndBufferedPaint(hBufferedPaint, TRUE); |
| 1438 | } |
| 1439 | } |
| 1440 | |
| 1441 | BOOL DetermineGlowSize(int* piSize, LPCWSTR pszClassIdList /*= nullptr*/) |
| 1442 | { |