From ede7389fb64a9c392f2931ea55c2696a80a902a2 Mon Sep 17 00:00:00 2001 From: Connie Sarah Date: Sat, 11 May 2024 11:22:39 +0300 Subject: [PATCH] [SNDVOL32] Add CTRL-S hotkey to switch between Small/Normal modes (#6867) This adds a hotkey (CTRL-S) which switches between the Normal and Small modes of the Volume Control window (also seen in Windows XP). CORE-17043 Signed-off-by: Connie Julie --- base/applications/sndvol32/sndvol32.c | 13 +++++++++++++ base/applications/sndvol32/sndvol32.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/base/applications/sndvol32/sndvol32.c b/base/applications/sndvol32/sndvol32.c index 426f5a9cb25..53d55d70d7b 100644 --- a/base/applications/sndvol32/sndvol32.c +++ b/base/applications/sndvol32/sndvol32.c @@ -971,6 +971,7 @@ MainWindowProc(HWND hwnd, case IDM_EXIT: { PostQuitMessage(0); + UnregisterHotKey(hwnd, HOTKEY_CTRL_S); break; } @@ -1248,6 +1249,8 @@ MainWindowProc(HWND hwnd, Result = -1; } } + + RegisterHotKey(hwnd, HOTKEY_CTRL_S, MOD_CONTROL, 'S'); break; } @@ -1275,6 +1278,16 @@ MainWindowProc(HWND hwnd, break; } + case WM_HOTKEY: + { + if (wParam == HOTKEY_CTRL_S) + { + Preferences.MixerWindow->Mode = (Preferences.MixerWindow->Mode == NORMAL_MODE ? SMALL_MODE : NORMAL_MODE); + RebuildMixerWindowControls(&Preferences); + } + break; + } + default: { Result = DefWindowProc(hwnd, diff --git a/base/applications/sndvol32/sndvol32.h b/base/applications/sndvol32/sndvol32.h index 970d98238f2..41da0ab310b 100644 --- a/base/applications/sndvol32/sndvol32.h +++ b/base/applications/sndvol32/sndvol32.h @@ -31,6 +31,8 @@ #define ADVANCED_BUTTON_HEIGHT 16 +#define HOTKEY_CTRL_S 1 + typedef enum _WINDOW_MODE { NORMAL_MODE,