MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / OnRightClick

Method OnRightClick

WinArk/VirtualListView.h:84–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 }
83
84 LRESULT OnRightClick(int, LPNMHDR hdr, BOOL& handled) {
85 WCHAR className[16];
86 if (!::GetClassName(hdr->hwndFrom, className, _countof(className))) {
87 handled = FALSE;
88 return 0;
89 }
90
91 if (::wcscmp(className, WC_LISTVIEW)) {
92 handled = FALSE;
93 return 0;
94 }
95
96 CListViewCtrl lv(hdr->hwndFrom);
97 POINT pt;
98 ::GetCursorPos(&pt);
99 POINT pt2(pt);
100 auto header = lv.GetHeader();
101 ATLASSERT(header);
102 header.ScreenToClient(&pt);
103 HDHITTESTINFO hti;
104 hti.pt = pt;
105 auto pT = static_cast<T*>(this);
106 int index = header.HitTest(&hti);
107 if (index >= 0) {
108 handled = pT->OnRightClickHeader(index, pt2);
109 }
110 else {
111 LVHITTESTINFO info{};
112 info.pt = pt;
113 lv.SubItemHitTest(&info);
114 handled = pT->OnRightClickList(hdr->hwndFrom,info.iItem, info.iSubItem, pt2);
115 }
116 return 0;
117 }
118
119 bool OnRightClickHeader(int index, POINT& pt) {
120 return false;

Callers

nothing calls this directly

Calls 2

OnRightClickHeaderMethod · 0.80
OnRightClickListMethod · 0.45

Tested by

no test coverage detected