aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-04-01 03:25:09 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-04-01 03:25:09 +0200
commita4e988fc5a727cc0c4b9718c6a2ac875d8413752 (patch)
tree2fa5d0d51d1dcd7a689c56c07ea24cf7e1485eee
parent54cdf98de41bac6d0134352d9bff2c208e02f579 (diff)
downloadEpisodeBrowser-a4e988fc5a727cc0c4b9718c6a2ac875d8413752.tar.gz
File > Reset selects most recently watched episode.
-rw-r--r--c/main.c25
-rw-r--r--c/resource.h1
-rw-r--r--c/resource.rc1
3 files changed, 18 insertions, 9 deletions
diff --git a/c/main.c b/c/main.c
index 52029c4..f22eabf 100644
--- a/c/main.c
+++ b/c/main.c
@@ -48,15 +48,15 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
HPopupMenu = GetSubMenu(HPopupMenu, 0);
memset(&wc, 0, sizeof(WNDCLASSEX));
- wc.cbSize = sizeof(WNDCLASSEX);
- wc.lpfnWndProc = WndProc;
- wc.hInstance = hInstance;
- wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.cbSize = sizeof(WNDCLASSEX);
+ wc.lpfnWndProc = WndProc;
+ wc.hInstance = hInstance;
+ wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
- wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU);
- wc.lpszClassName = TEXT("EpisodeBrowser");
- wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
+ wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU);
+ wc.lpszClassName = TEXT("Episode Browser");
+ wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
tszErr = TEXT("Could not register window class.");
if (!RegisterClassEx(&wc)) goto f;
@@ -64,7 +64,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
hWnd = CreateWindowEx(
0,
- TEXT("EpisodeBrowser"),
+ TEXT("Episode Browser"),
TEXT("Episode Browser"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 510, 400,
@@ -151,6 +151,13 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case ID_FILE_REFRESH:
ElvUpdate();
break;
+ case ID_FILE_RESET:
+ {
+ extern HWND HElv;
+ ListView_SetItemState(HElv, -1, LVIF_STATE, LVIS_SELECTED);
+ ElvSelectRecent();
+ break;
+ }
case ID_FILE_ABOUT:
DialogBox(
GetModuleHandle(NULL),
diff --git a/c/resource.h b/c/resource.h
index 5893ad4..e810a30 100644
--- a/c/resource.h
+++ b/c/resource.h
@@ -9,6 +9,7 @@
#define IDC_DATALISTVIEW 303
#define ID_FILE_EXIT 401
#define ID_FILE_REFRESH 402
+#define ID_FILE_RESET 403
#define ID_FILE_ABOUT 411
#define ID_WATCH 421
#define ID_TOGGLE 422
diff --git a/c/resource.rc b/c/resource.rc
index a5e9362..134fe72 100644
--- a/c/resource.rc
+++ b/c/resource.rc
@@ -8,6 +8,7 @@ BEGIN
POPUP "&File"
BEGIN
MENUITEM "&Refresh", ID_FILE_REFRESH
+ MENUITEM "Re&set", ID_FILE_RESET
MENUITEM "E&xit", ID_FILE_EXIT
END
POPUP "&Help"