Skip to content

Commit

Permalink
Set menu id for InsertMenuItem().
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Dec 10, 2023
1 parent 361920b commit 75b231f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Notepad2.c
Original file line number Diff line number Diff line change
Expand Up @@ -5352,13 +5352,14 @@ LRESULT MsgNotify(HWND hwnd, WPARAM wParam, LPARAM lParam) {
BitmapCache_StartUse(&bitmapCache);
MENUITEMINFO mii;
mii.cbSize = sizeof(MENUITEMINFO);
mii.fMask = MIIM_STRING | MIIM_BITMAP;
mii.fMask = MIIM_ID | MIIM_STRING | MIIM_BITMAP;
for (int i = 0; i < count; i++) {
LPCWSTR path = mruFile.pszItems[i];
HBITMAP hbmp = BitmapCache_Get(&bitmapCache, path);
mii.wID = i + IDM_RECENT_HISTORY_START;
mii.dwTypeData = (LPWSTR)path;
mii.hbmpItem = hbmp;
InsertMenuItem(subMenu, i + IDM_RECENT_HISTORY_START, FALSE, &mii);
InsertMenuItem(subMenu, i, TRUE, &mii);
}
} else {
hmenu = LoadMenu(g_hInstance, MAKEINTRESOURCE(IDR_POPUPMENU));
Expand Down

0 comments on commit 75b231f

Please sign in to comment.