diff options
author | John Ankarström <john@ankarstrom.se> | 2022-07-29 21:20:44 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-07-29 21:20:44 +0200 |
commit | 2b8b6ac284dca2bd22514d293519cb877a1079d8 (patch) | |
tree | cf1a212a5be583d52d4965508218be358f6879e4 /c/main.cpp | |
parent | c883d9cf5673fe0af8d69120b048d642e122bdbb (diff) | |
download | EpisodeBrowser-2b8b6ac284dca2bd22514d293519cb877a1079d8.tar.gz |
Add ListView::FindNextItem.
This makes it much more ergonomic and less error-prone to look up list
view items.
Diffstat (limited to 'c/main.cpp')
-rw-r--r-- | c/main.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -406,16 +406,13 @@ void WndProcMainMenu(const HWND hWnd, unsigned short wCommand) /* Process context menu commands. */ void WndProcContextMenu(const HWND, unsigned short wCommand) { - LVITEM lvi; int cNotFound = 0; /* Look through selected items, applying the * selected command to each one. */ - lvi.mask = LVIF_PARAM; - lvi.iItem = -1; - while ((lvi.iItem = ListView_GetNextItem(g_pElv->hWnd, lvi.iItem, LVNI_SELECTED)) != -1 - && ListView_GetItem(g_pElv->hWnd, &lvi)) { + LVITEM lvi = {LVIF_PARAM, -1}; + while (g_pElv->FindNextItem(&lvi, LVNI_SELECTED)) { /* Process rate commands. */ if (ID_SUBGROUP(wCommand) == IDG_CTX_RATE) { |