Created the application, turned into the taskbar. Created a context menu from one item, it is successfully called by PCM. Now, I would like to handle clicking on the menu item. Here is the code, but it doesn't work:
case TREY_MESSAGE: // своя константа { switch (lParam) { case WM_RBUTTONUP: { // Извлекаю координаты курсора мыши GetCursorPos(&pt); // т.к. координаты не передаются в функцию, берём напрямую // Отображаем меню TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL); return 0; } case WM_LBUTTONUP: { // щёлчек левой кнопкой мышки return 0; } case WM_COMMAND: { // отладчик здесь не останавливается MessageBoxA(hwnd, "test", "test", MB_OK); if (LOWORD(wParam) == MENU_EXIT) // MENU_EXIT - идентификатор пункта меню PostMessage(hwnd, WM_CLOSE, lParam, wParam); return 0; } default: return 0; } } Blocks WM_RBUTTONUP, WM_LBUTTONUP (this one for the test) are processed, but they do not persist in WM_COMMAND. How to treat?