aboutsummaryrefslogtreecommitdiff
path: root/c/main.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-29 21:20:44 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-29 21:20:44 +0200
commit2b8b6ac284dca2bd22514d293519cb877a1079d8 (patch)
treecf1a212a5be583d52d4965508218be358f6879e4 /c/main.cpp
parentc883d9cf5673fe0af8d69120b048d642e122bdbb (diff)
downloadEpisodeBrowser-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.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/c/main.cpp b/c/main.cpp
index 673affe..7fef22e 100644
--- a/c/main.cpp
+++ b/c/main.cpp
@@ -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) {