aboutsummaryrefslogtreecommitdiff
path: root/c/listview.c
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-03-02 21:48:41 +0100
committerJohn Ankarström <john@ankarstrom.se>2022-03-02 21:48:41 +0100
commit85cf754ff86c053c4f7a34b57b1528c0cf655b35 (patch)
tree63456b2ba31b501ca1e0cf8683ff969868760a07 /c/listview.c
parent56d4f25db9cedb5b45a731ce2db004fb03ccc001 (diff)
downloadEpisodeBrowser-85cf754ff86c053c4f7a34b57b1528c0cf655b35.tar.gz
Open episode on Enter.
This case cannot be handled by NM_RETURN, as the Return key is handled by IsDialogMessage (in the message loop in main), which sends a WM_GETDLGCODE message to the active control.
Diffstat (limited to 'c/listview.c')
-rw-r--r--c/listview.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/c/listview.c b/c/listview.c
index 7039e89..3025297 100644
--- a/c/listview.c
+++ b/c/listview.c
@@ -47,6 +47,20 @@ LvProc(HWND hLv, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TRUE;
}
break;
+ case WM_GETDLGCODE: /* Open episode on Enter. */
+ {
+ LRESULT lResult;
+ extern HWND HElv;
+ extern LPLVITEM LpLviElvSelection;
+ if (hLv != HElv) break;
+ lResult = CallWindowProc(LvPrevProc, hLv, uMsg, wParam, lParam);
+ if (lParam && ((MSG *)lParam)->message == WM_KEYDOWN
+ && ((MSG *)lParam)->wParam == VK_RETURN) {
+ lResult &= ~DLGC_WANTMESSAGE;
+ ElvEnter(LpLviElvSelection);
+ }
+ return lResult;
+ }
}
return CallWindowProc(LvPrevProc, hLv, uMsg, wParam, lParam);