adapted from https://devblogs.microsoft.com/oldnewthing/20040928-00/?p=37723
| 253 | // https://devblogs.microsoft.com/oldnewthing/20040928-00/?p=37723 |
| 254 | // |
| 255 | void 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 | |
| 276 | void ShellMenu::create() |
| 277 | { |
nothing calls this directly
no test coverage detected