| 357 | } |
| 358 | |
| 359 | LRESULT CALLBACK CallWndSubClassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) { |
| 360 | switch (uMsg) { |
| 361 | case WM_CTLCOLORDLG: |
| 362 | { |
| 363 | return (INT_PTR)LoadThemeConfig()->menubar_bgcolor; |
| 364 | } |
| 365 | case WM_CTLCOLOREDIT: |
| 366 | { |
| 367 | HDC hdcStatic = (HDC)wParam; |
| 368 | SetTextColor(hdcStatic, LoadThemeConfig()->menubar_textcolor); |
| 369 | SetBkColor(hdcStatic, LoadThemeConfig()->menubar_bgcolor); |
| 370 | return (INT_PTR)LoadThemeConfig()->menubar_bgbrush; |
| 371 | } |
| 372 | case WM_CTLCOLORLISTBOX: |
| 373 | { |
| 374 | if (IsWndClass(hWnd, L"ComboBox")) { |
| 375 | COMBOBOXINFO info; |
| 376 | info.cbSize = sizeof(info); |
| 377 | SendMessage(hWnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&info); |
| 378 | |
| 379 | if ((HWND)lParam == info.hwndList) |
| 380 | { |
| 381 | HDC dc = (HDC)wParam; |
| 382 | SetBkMode(dc, OPAQUE); |
| 383 | SetTextColor(dc, LoadThemeConfig()->menubar_textcolor); |
| 384 | SetBkColor(dc, LoadThemeConfig()->menubar_bgcolor); |
| 385 | return (LRESULT)LoadThemeConfig()->menubar_bgbrush; |
| 386 | } |
| 387 | } |
| 388 | break; |
| 389 | } |
| 390 | case WM_CTLCOLORSCROLLBAR: |
| 391 | { |
| 392 | HDC hdc = reinterpret_cast<HDC>(wParam); |
| 393 | SetTextColor(hdc, LoadThemeConfig()->menubar_textcolor); |
| 394 | SetBkColor(hdc, LoadThemeConfig()->menubar_bgcolor); |
| 395 | return reinterpret_cast<LRESULT>(LoadThemeConfig()->menubar_bgbrush); |
| 396 | } |
| 397 | case WM_CTLCOLORSTATIC: |
| 398 | { |
| 399 | HDC hdc = reinterpret_cast<HDC>(wParam); |
| 400 | SetTextColor(hdc, LoadThemeConfig()->menubar_textcolor); |
| 401 | SetBkColor(hdc, LoadThemeConfig()->menubar_bgcolor); |
| 402 | return reinterpret_cast<LRESULT>(LoadThemeConfig()->menubar_bgbrush); |
| 403 | } |
| 404 | case WM_DRAWITEM: |
| 405 | { |
| 406 | const DRAWITEMSTRUCT& dis = *(DRAWITEMSTRUCT*)lParam; |
| 407 | if (dis.CtlType == ODT_BUTTON) { |
| 408 | if (dis.itemAction) { |
| 409 | PaintODTBUTTON(dis); |
| 410 | if (dis.itemState & ODS_FOCUS) { |
| 411 | DrawFocusRect(dis.hDC, &dis.rcItem); |
| 412 | } |
| 413 | } |
| 414 | return TRUE; |
| 415 | } |
| 416 | break; |
nothing calls this directly
no test coverage detected