MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / onMenuSelect

Method onMenuSelect

src/envshell.cpp:255–274  ·  view source on GitHub ↗

adapted from https://devblogs.microsoft.com/oldnewthing/20040928-00/?p=37723

Source from the content-addressed store, hash-verified

253// https://devblogs.microsoft.com/oldnewthing/20040928-00/?p=37723
254//
255void ShellMenu::onMenuSelect(HWND hwnd, HMENU hmenu, int item, HMENU hmenuPopup,
256 UINT flags)
257{
258 if (m_cm && item >= QCM_FIRST && item <= QCM_LAST) {
259 WCHAR szBuf[MAX_PATH];
260
261 const auto r = IContextMenu_GetCommandString(m_cm.get(), item - QCM_FIRST,
262 GCS_HELPTEXTW, NULL, szBuf, MAX_PATH);
263
264 if (FAILED(r)) {
265 lstrcpynW(szBuf, L"No help available.", MAX_PATH);
266 }
267
268 if (m_mw) {
269 if (auto* sb = m_mw->statusBar()) {
270 sb->showMessage(QString::fromWCharArray(szBuf));
271 }
272 }
273 }
274}
275
276void ShellMenu::create()
277{

Callers

nothing calls this directly

Calls 4

getMenuMethod · 0.80
getMethod · 0.45
showMessageMethod · 0.45

Tested by

no test coverage detected