https://git.reactos.org/?p=reactos.git;a=commitdiff;h=40bd09a2ce78328f70904…
commit 40bd09a2ce78328f709047c420f46e0925978d8b
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Feb 25 21:58:34 2018 +0100
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Mon Feb 26 00:44:41 2018 +0100
[SNDVOL32] Add the tray volume dialog
- Add the tray volume dialog (run "sndvol32 /t").
- Add a simple command line parser.
---
base/applications/sndvol32/CMakeLists.txt | 1 +
base/applications/sndvol32/lang/bg-BG.rc | 10 +++
base/applications/sndvol32/lang/cs-CZ.rc | 10 +++
base/applications/sndvol32/lang/de-DE.rc | 10 +++
base/applications/sndvol32/lang/el-GR.rc | 10 +++
base/applications/sndvol32/lang/en-US.rc | 10 +++
base/applications/sndvol32/lang/es-ES.rc | 10 +++
base/applications/sndvol32/lang/fr-FR.rc | 10 +++
base/applications/sndvol32/lang/he-IL.rc | 10 +++
base/applications/sndvol32/lang/hu-HU.rc | 10 +++
base/applications/sndvol32/lang/id-ID.rc | 10 +++
base/applications/sndvol32/lang/it-IT.rc | 10 +++
base/applications/sndvol32/lang/ja-JP.rc | 10 +++
base/applications/sndvol32/lang/ko-KR.rc | 10 +++
base/applications/sndvol32/lang/lt-LT.rc | 10 +++
base/applications/sndvol32/lang/nl-NL.rc | 10 +++
base/applications/sndvol32/lang/no-NO.rc | 10 +++
base/applications/sndvol32/lang/pl-PL.rc | 10 +++
base/applications/sndvol32/lang/pt-BR.rc | 10 +++
base/applications/sndvol32/lang/ro-RO.rc | 10 +++
base/applications/sndvol32/lang/ru-RU.rc | 10 +++
base/applications/sndvol32/lang/sk-SK.rc | 10 +++
base/applications/sndvol32/lang/sq-AL.rc | 10 +++
base/applications/sndvol32/lang/sv-SE.rc | 10 +++
base/applications/sndvol32/lang/th-TH.rc | 10 +++
base/applications/sndvol32/lang/tr-TR.rc | 10 +++
base/applications/sndvol32/lang/uk-UA.rc | 10 +++
base/applications/sndvol32/lang/zh-CN.rc | 10 +++
base/applications/sndvol32/lang/zh-TW.rc | 10 +++
base/applications/sndvol32/resources.h | 1 +
base/applications/sndvol32/sndvol32.c | 112 ++++++++++++++++++++++++------
base/applications/sndvol32/sndvol32.h | 10 +++
base/applications/sndvol32/tray.c | 71 +++++++++++++++++++
33 files changed, 453 insertions(+), 22 deletions(-)
diff --git a/base/applications/sndvol32/CMakeLists.txt
b/base/applications/sndvol32/CMakeLists.txt
index 3d97d129de..dd1827368a 100644
--- a/base/applications/sndvol32/CMakeLists.txt
+++ b/base/applications/sndvol32/CMakeLists.txt
@@ -4,6 +4,7 @@ list(APPEND SOURCE
misc.c
mixer.c
sndvol32.c
+ tray.c
sndvol32.h)
add_rc_deps(sndvol32.rc ${CMAKE_CURRENT_SOURCE_DIR}/resources/sndvol32.ico)
diff --git a/base/applications/sndvol32/lang/bg-BG.rc
b/base/applications/sndvol32/lang/bg-BG.rc
index 4bd1fabfc9..6ac13cd18e 100644
--- a/base/applications/sndvol32/lang/bg-BG.rc
+++ b/base/applications/sndvol32/lang/bg-BG.rc
@@ -58,3 +58,13 @@ BEGIN
CHECKBOX "За&глушаване", IDC_LINE_SWITCH, 4, 190, 110, 16,
BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Сила", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "За&глушаване", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/cs-CZ.rc
b/base/applications/sndvol32/lang/cs-CZ.rc
index be0dd0c510..1ac95bcda7 100644
--- a/base/applications/sndvol32/lang/cs-CZ.rc
+++ b/base/applications/sndvol32/lang/cs-CZ.rc
@@ -60,3 +60,13 @@ BEGIN
CHECKBOX "&Ztlumit", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Hlasitost", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Ztlumit", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/de-DE.rc
b/base/applications/sndvol32/lang/de-DE.rc
index 7d36e8d688..4df44041f7 100644
--- a/base/applications/sndvol32/lang/de-DE.rc
+++ b/base/applications/sndvol32/lang/de-DE.rc
@@ -54,3 +54,13 @@ BEGIN
CHECKBOX "&Stumm", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Lautstärke", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Stumm", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/el-GR.rc
b/base/applications/sndvol32/lang/el-GR.rc
index 7265a3ff6c..4c8e33ca03 100644
--- a/base/applications/sndvol32/lang/el-GR.rc
+++ b/base/applications/sndvol32/lang/el-GR.rc
@@ -54,3 +54,13 @@ BEGIN
CHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volume", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/en-US.rc
b/base/applications/sndvol32/lang/en-US.rc
index e7774a9a37..3a5e80fac6 100644
--- a/base/applications/sndvol32/lang/en-US.rc
+++ b/base/applications/sndvol32/lang/en-US.rc
@@ -54,3 +54,13 @@ BEGIN
CHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volume", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/es-ES.rc
b/base/applications/sndvol32/lang/es-ES.rc
index 8ba4fc4efc..ef7a74eeaf 100644
--- a/base/applications/sndvol32/lang/es-ES.rc
+++ b/base/applications/sndvol32/lang/es-ES.rc
@@ -57,3 +57,13 @@ BEGIN
CHECKBOX "&Silenciar", IDC_LINE_SWITCH, 4, 190, 90, 12,
BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volumen", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Silenciar", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/fr-FR.rc
b/base/applications/sndvol32/lang/fr-FR.rc
index 977f1668bd..7331e0ed92 100644
--- a/base/applications/sndvol32/lang/fr-FR.rc
+++ b/base/applications/sndvol32/lang/fr-FR.rc
@@ -54,3 +54,13 @@ BEGIN
CHECKBOX "&Muet", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volume", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Muet", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/he-IL.rc
b/base/applications/sndvol32/lang/he-IL.rc
index 02bd4c6e6a..3779376bc7 100644
--- a/base/applications/sndvol32/lang/he-IL.rc
+++ b/base/applications/sndvol32/lang/he-IL.rc
@@ -56,3 +56,13 @@ BEGIN
CHECKBOX "השתק", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "עוצמה", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "השתק", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/hu-HU.rc
b/base/applications/sndvol32/lang/hu-HU.rc
index 373c1d59bf..759ce74b3a 100644
--- a/base/applications/sndvol32/lang/hu-HU.rc
+++ b/base/applications/sndvol32/lang/hu-HU.rc
@@ -56,3 +56,13 @@ BEGIN
CHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volume", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/id-ID.rc
b/base/applications/sndvol32/lang/id-ID.rc
index 3612ab0ab4..cc6327bcfc 100644
--- a/base/applications/sndvol32/lang/id-ID.rc
+++ b/base/applications/sndvol32/lang/id-ID.rc
@@ -54,3 +54,13 @@ BEGIN
CHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volume", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/it-IT.rc
b/base/applications/sndvol32/lang/it-IT.rc
index 6794625ffd..3678b5bf0a 100644
--- a/base/applications/sndvol32/lang/it-IT.rc
+++ b/base/applications/sndvol32/lang/it-IT.rc
@@ -54,3 +54,13 @@ BEGIN
CHECKBOX "&Disattiva", IDC_LINE_SWITCH, 4, 190, 90, 12,
BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volume", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Disattiva", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/ja-JP.rc
b/base/applications/sndvol32/lang/ja-JP.rc
index c57639b20d..61a7b69e1a 100644
--- a/base/applications/sndvol32/lang/ja-JP.rc
+++ b/base/applications/sndvol32/lang/ja-JP.rc
@@ -54,3 +54,13 @@ BEGIN
CHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 9, "MS UI Gothic"
+BEGIN
+ CTEXT "Volume", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/ko-KR.rc
b/base/applications/sndvol32/lang/ko-KR.rc
index 99c5c40b33..1abeb34f03 100644
--- a/base/applications/sndvol32/lang/ko-KR.rc
+++ b/base/applications/sndvol32/lang/ko-KR.rc
@@ -56,3 +56,13 @@ BEGIN
CHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 9, "굴림"
+BEGIN
+ CTEXT "Volume", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/lt-LT.rc
b/base/applications/sndvol32/lang/lt-LT.rc
index e241dc516c..7c44bf2eae 100644
--- a/base/applications/sndvol32/lang/lt-LT.rc
+++ b/base/applications/sndvol32/lang/lt-LT.rc
@@ -56,3 +56,13 @@ BEGIN
CHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volume", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/nl-NL.rc
b/base/applications/sndvol32/lang/nl-NL.rc
index e89e20ec76..18e0bb2889 100644
--- a/base/applications/sndvol32/lang/nl-NL.rc
+++ b/base/applications/sndvol32/lang/nl-NL.rc
@@ -54,3 +54,13 @@ BEGIN
CHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volume", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/no-NO.rc
b/base/applications/sndvol32/lang/no-NO.rc
index 8634227c19..ef4bde48b9 100644
--- a/base/applications/sndvol32/lang/no-NO.rc
+++ b/base/applications/sndvol32/lang/no-NO.rc
@@ -54,3 +54,13 @@ BEGIN
CHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volume", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/pl-PL.rc
b/base/applications/sndvol32/lang/pl-PL.rc
index 05cfbbe303..40610bbfe7 100644
--- a/base/applications/sndvol32/lang/pl-PL.rc
+++ b/base/applications/sndvol32/lang/pl-PL.rc
@@ -62,3 +62,13 @@ BEGIN
CHECKBOX "&Wycisz", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Głośność", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Wycisz", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/pt-BR.rc
b/base/applications/sndvol32/lang/pt-BR.rc
index 54582e241e..146ffb6721 100644
--- a/base/applications/sndvol32/lang/pt-BR.rc
+++ b/base/applications/sndvol32/lang/pt-BR.rc
@@ -56,3 +56,13 @@ BEGIN
CHECKBOX "&Mudo", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volume", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Mudo", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/ro-RO.rc
b/base/applications/sndvol32/lang/ro-RO.rc
index ebd21954ef..17cf0379e3 100644
--- a/base/applications/sndvol32/lang/ro-RO.rc
+++ b/base/applications/sndvol32/lang/ro-RO.rc
@@ -55,3 +55,13 @@ BEGIN
CHECKBOX "A&muțește tot", IDC_LINE_SWITCH, 4, 190, 90, 12,
BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volum", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "A&muțește tot", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/ru-RU.rc
b/base/applications/sndvol32/lang/ru-RU.rc
index 7ed361747c..b9df68910a 100644
--- a/base/applications/sndvol32/lang/ru-RU.rc
+++ b/base/applications/sndvol32/lang/ru-RU.rc
@@ -56,3 +56,13 @@ BEGIN
CHECKBOX "В&ыкл. все", IDC_LINE_SWITCH, 4, 190, 90, 12,
BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Громкость", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "В&ыкл. все", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/sk-SK.rc
b/base/applications/sndvol32/lang/sk-SK.rc
index 8e062cf7bf..b58b95ddad 100644
--- a/base/applications/sndvol32/lang/sk-SK.rc
+++ b/base/applications/sndvol32/lang/sk-SK.rc
@@ -56,3 +56,13 @@ BEGIN
CHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volume", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/sq-AL.rc
b/base/applications/sndvol32/lang/sq-AL.rc
index ee3089fc02..ac94cdb36d 100644
--- a/base/applications/sndvol32/lang/sq-AL.rc
+++ b/base/applications/sndvol32/lang/sq-AL.rc
@@ -58,3 +58,13 @@ BEGIN
CHECKBOX "Heshtur", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volumi", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "Heshtur", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/sv-SE.rc
b/base/applications/sndvol32/lang/sv-SE.rc
index f0159ef455..1695b69b1f 100644
--- a/base/applications/sndvol32/lang/sv-SE.rc
+++ b/base/applications/sndvol32/lang/sv-SE.rc
@@ -56,3 +56,13 @@ BEGIN
CHECKBOX "&Tyst", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volyme", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Tyst", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/th-TH.rc
b/base/applications/sndvol32/lang/th-TH.rc
index 90f19d40f3..b8ab88c434 100644
--- a/base/applications/sndvol32/lang/th-TH.rc
+++ b/base/applications/sndvol32/lang/th-TH.rc
@@ -62,3 +62,13 @@ BEGIN
CHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Volume", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/tr-TR.rc
b/base/applications/sndvol32/lang/tr-TR.rc
index 300c24ca77..ae98afc4cb 100644
--- a/base/applications/sndvol32/lang/tr-TR.rc
+++ b/base/applications/sndvol32/lang/tr-TR.rc
@@ -56,3 +56,13 @@ BEGIN
CHECKBOX "S&essiz", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Ses Düzeyi", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "S&essiz", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/uk-UA.rc
b/base/applications/sndvol32/lang/uk-UA.rc
index f5001c526b..19270442c7 100644
--- a/base/applications/sndvol32/lang/uk-UA.rc
+++ b/base/applications/sndvol32/lang/uk-UA.rc
@@ -62,3 +62,13 @@ BEGIN
CHECKBOX "&Тиша", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 8, "MS Shell Dlg"
+BEGIN
+ CTEXT "Гучність", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "&Тиша", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/zh-CN.rc
b/base/applications/sndvol32/lang/zh-CN.rc
index 6726c3d01e..d4cea71d42 100644
--- a/base/applications/sndvol32/lang/zh-CN.rc
+++ b/base/applications/sndvol32/lang/zh-CN.rc
@@ -56,3 +56,13 @@ BEGIN
CHECKBOX "静音(&M)", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 9, "宋体"
+BEGIN
+ CTEXT "音量", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "静音(&M)", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/lang/zh-TW.rc
b/base/applications/sndvol32/lang/zh-TW.rc
index 2a75b3464b..d70bbd0a3e 100644
--- a/base/applications/sndvol32/lang/zh-TW.rc
+++ b/base/applications/sndvol32/lang/zh-TW.rc
@@ -56,3 +56,13 @@ BEGIN
CHECKBOX "靜音(&M)", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX
CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD |
WS_VISIBLE, 130, 7, 1, 200
END
+
+IDD_TRAY_CTRL DIALOGEX 0, 0, 50, 80
+STYLE DS_MODALFRAME | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+FONT 9, "新細明體"
+BEGIN
+ CTEXT "音量", -1, 0, 4, 50, 8
+ CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT |
TBS_BOTH | TBS_NOTICKS | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 16, 15, 20, 50
+ AUTOCHECKBOX "靜音(&M)", IDC_LINE_SWITCH, 4, 70, 44, 8
+END
diff --git a/base/applications/sndvol32/resources.h
b/base/applications/sndvol32/resources.h
index 85dfed93dd..80f82e7b1f 100644
--- a/base/applications/sndvol32/resources.h
+++ b/base/applications/sndvol32/resources.h
@@ -28,3 +28,4 @@
#define IDD_VOLUME_CTRL 200
#define IDD_PREFERENCES 201
+#define IDD_TRAY_CTRL 202
diff --git a/base/applications/sndvol32/sndvol32.c
b/base/applications/sndvol32/sndvol32.c
index b19f99e0f3..7531518d64 100644
--- a/base/applications/sndvol32/sndvol32.c
+++ b/base/applications/sndvol32/sndvol32.c
@@ -1136,6 +1136,61 @@ CreateApplicationWindow(VOID)
return hWnd;
}
+static
+BOOL
+HandleCommandLine(LPTSTR cmdline,
+ PBOOL pTray)
+{
+ TCHAR option;
+
+ while (*cmdline == _T(' ') || *cmdline == _T('-') || *cmdline ==
_T('/'))
+ {
+ if (*cmdline++ == _T(' '))
+ continue;
+
+ option = *cmdline;
+ if (option)
+ cmdline++;
+ while (*cmdline == _T(' '))
+ cmdline++;
+
+ switch (option)
+ {
+ case 'd': /* Device */
+ case 'D':
+ break;
+
+ case 'n': /* Normal size */
+ case 'N':
+ *pTray = FALSE;
+ break;
+
+ case 's': /* Small size */
+ case 'S':
+ *pTray = FALSE;
+ break;
+
+ case 't': /* Tray size */
+ case 'T':
+ *pTray = TRUE;
+ break;
+
+ case 'p': /* Play mode */
+ case 'P':
+ break;
+
+ case 'r': /* Record mode */
+ case 'R':
+ break;
+
+ default:
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
int WINAPI
_tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
@@ -1145,14 +1200,16 @@ _tWinMain(HINSTANCE hInstance,
MSG Msg;
int Ret = 1;
INITCOMMONCONTROLSEX Controls;
+ BOOL bTray = FALSE;
UNREFERENCED_PARAMETER(hPrevInstance);
- UNREFERENCED_PARAMETER(lpszCmdLine);
- UNREFERENCED_PARAMETER(nCmdShow);
+ UNREFERENCED_PARAMETER(nCmdShow);
hAppInstance = hInstance;
hAppHeap = GetProcessHeap();
+ HandleCommandLine(lpszCmdLine, &bTray);
+
if (InitAppConfig())
{
/* load the application title */
@@ -1168,37 +1225,48 @@ _tWinMain(HINSTANCE hInstance,
InitCommonControlsEx(&Controls);
- if (RegisterApplicationClasses())
+ if (bTray)
+ {
+ DialogBoxParam(hAppInstance,
+ MAKEINTRESOURCE(IDD_TRAY_CTRL),
+ NULL,
+ TrayDlgProc,
+ 0);
+ }
+ else
{
- hMainWnd = CreateApplicationWindow();
- if (hMainWnd != NULL)
+ if (RegisterApplicationClasses())
{
- BOOL bRet;
- while ((bRet =GetMessage(&Msg,
- NULL,
- 0,
- 0)) != 0)
+ hMainWnd = CreateApplicationWindow();
+ if (hMainWnd != NULL)
{
- if (bRet != -1)
+ BOOL bRet;
+ while ((bRet =GetMessage(&Msg,
+ NULL,
+ 0,
+ 0)) != 0)
{
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
+ if (bRet != -1)
+ {
+ TranslateMessage(&Msg);
+ DispatchMessage(&Msg);
+ }
}
+
+ DestroyWindow(hMainWnd);
+ Ret = 0;
+ }
+ else
+ {
+ DPRINT("Failed to create application window (LastError:
%d)!\n", GetLastError());
}
- DestroyWindow(hMainWnd);
- Ret = 0;
+ UnregisterApplicationClasses();
}
else
{
- DPRINT("Failed to create application window (LastError:
%d)!\n", GetLastError());
+ DPRINT("Failed to register application classes (LastError:
%d)!\n", GetLastError());
}
-
- UnregisterApplicationClasses();
- }
- else
- {
- DPRINT("Failed to register application classes (LastError: %d)!\n",
GetLastError());
}
if (lpAppTitle != NULL)
diff --git a/base/applications/sndvol32/sndvol32.h
b/base/applications/sndvol32/sndvol32.h
index cd9c7ad5b3..f98f23d493 100644
--- a/base/applications/sndvol32/sndvol32.h
+++ b/base/applications/sndvol32/sndvol32.h
@@ -164,4 +164,14 @@ WriteLineConfig(IN LPTSTR szDeviceName,
IN PSNDVOL_REG_LINESTATE LineState,
IN DWORD cbSize);
+/* tray.c */
+
+INT_PTR
+CALLBACK
+TrayDlgProc(
+ HWND hwndDlg,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam);
+
#endif /* __SNDVOL32_H */
diff --git a/base/applications/sndvol32/tray.c b/base/applications/sndvol32/tray.c
new file mode 100644
index 0000000000..2223aadaef
--- /dev/null
+++ b/base/applications/sndvol32/tray.c
@@ -0,0 +1,71 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Sound Volume Control
+ * FILE: base/applications/sndvol32/tray.c
+ * PROGRAMMERS: Eric Kohl <eric.kohl(a)reactos.org>
+ */
+
+#include "sndvol32.h"
+
+static VOID
+OnTrayInitDialog(
+ HWND hwnd,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ POINT ptCursor;
+ RECT rcWindow;
+ RECT rcScreen;
+ LONG x, y, cx, cy;
+
+ GetCursorPos(&ptCursor);
+
+ GetWindowRect(hwnd, &rcWindow);
+
+ GetWindowRect(GetDesktopWindow(), &rcScreen);
+
+ cx = rcWindow.right - rcWindow.left;
+ cy = rcWindow.bottom - rcWindow.top;
+
+ if (ptCursor.y + cy > rcScreen.bottom)
+ y = ptCursor.y - cy;
+ else
+ y = ptCursor.y;
+
+ if (ptCursor.x + cx > rcScreen.right)
+ x = ptCursor.x - cx;
+ else
+ x = ptCursor.x;
+
+ SetWindowPos(hwnd, HWND_TOPMOST, x, y, 0, 0, SWP_NOSIZE);
+
+ /* Disable the controls for now */
+ EnableWindow(GetDlgItem(hwnd, IDC_LINE_SLIDER_VERT), FALSE);
+ EnableWindow(GetDlgItem(hwnd, IDC_LINE_SWITCH), FALSE);
+}
+
+
+INT_PTR
+CALLBACK
+TrayDlgProc(
+ HWND hwndDlg,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ switch (uMsg)
+ {
+ case WM_INITDIALOG:
+ OnTrayInitDialog(hwndDlg, wParam, lParam);
+ break;
+
+ case WM_ACTIVATE:
+ if (LOWORD(wParam) == WA_INACTIVE)
+ EndDialog(hwndDlg, IDOK);
+ break;
+ }
+
+ return 0;
+}
+
+/* EOF */