MCPcopy Create free account
hub / github.com/Chaoses-Ib/IbEverythingExt / everything_window_proc

Function everything_window_proc

EverythingExt/quick_select.cpp:549–642  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

547
548WNDPROC everything_window_proc_prev;
549LRESULT CALLBACK everything_window_proc(
550 _In_ HWND hwnd,
551 _In_ UINT uMsg,
552 _In_ WPARAM wParam,
553 _In_ LPARAM lParam)
554{
555 switch (uMsg) {
556 case WM_MEASUREITEM: {
557 MEASUREITEMSTRUCT* measure = (MEASUREITEMSTRUCT*)lParam;
558 if (measure->CtlType != ODT_LISTVIEW)
559 break;
560
561 HWND quick_list = (HWND)GetPropW(hwnd, everything_prop_quick_list); // measure->CtlID == 0?
562 QuickListData* data = (QuickListData*)GetPropW(quick_list, quick_list_prop);
563 if (!data) {
564 DebugOStream() << L"everything quick_list prop is null\n";
565 break;
566 }
567 measure->itemHeight = data->item_height ? data->item_height : data->default_item_height;
568
569 return true;
570 }
571 case WM_DRAWITEM: {
572 DRAWITEMSTRUCT* draw = (DRAWITEMSTRUCT*)lParam;
573 QuickListData* data;
574 if (draw->CtlType != ODT_LISTVIEW || !(data = (QuickListData*)GetPropW(draw->hwndItem, quick_list_prop)))
575 break;
576
577 HDC dc = draw->hDC;
578
579 FillRect(dc, &draw->rcItem, data->background_brush);
580
581 /*
582 wchar_t s;
583 if (0 <= draw->itemID && draw->itemID < 9)
584 s = L'1' + draw->itemID;
585 else if (draw->itemID == 9)
586 s = L'0';
587 else if (draw->itemID < 10 + 26)
588 s = L'A' + draw->itemID - 10;
589 else
590 return true;
591 */
592 wchar_t s[] = L"1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
593 if (draw->itemID >= std::size(s) - 1)
594 return true;
595
596 /*
597 // fix the right (the column width is 0x7FFF)
598 RECT quick_rect;
599 GetWindowRect(draw->hwndItem, &quick_rect);
600 draw->rcItem.right = draw->rcItem.left + (quick_rect.right - quick_rect.left);
601 */
602 draw->rcItem.left = data->left_key_padding;
603
604 SetTextColor(dc, data->text_color);
605
606 HFONT font = (HFONT)SendMessageW(data->list_header, WM_GETFONT, 0, 0);

Callers

nothing calls this directly

Calls 1

DebugOStreamFunction · 0.85

Tested by

no test coverage detected