[SNDVOL32] Add the tray volume dialog

- Add the tray volume dialog (run "sndvol32 /t").
- Add a simple command line parser.
This commit is contained in:
Eric Kohl 2018-02-25 21:58:34 +01:00
parent 295ea36f9e
commit 40bd09a2ce
33 changed files with 460 additions and 29 deletions

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -28,3 +28,4 @@
#define IDD_VOLUME_CTRL 200
#define IDD_PREFERENCES 201
#define IDD_TRAY_CTRL 202

View file

@ -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)
{
hMainWnd = CreateApplicationWindow();
if (hMainWnd != NULL)
{
BOOL bRet;
while ((bRet =GetMessage(&Msg,
NULL,
0,
0)) != 0)
{
if (bRet != -1)
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
}
DestroyWindow(hMainWnd);
Ret = 0;
}
else
{
DPRINT("Failed to create application window (LastError: %d)!\n", GetLastError());
}
UnregisterApplicationClasses();
DialogBoxParam(hAppInstance,
MAKEINTRESOURCE(IDD_TRAY_CTRL),
NULL,
TrayDlgProc,
0);
}
else
{
DPRINT("Failed to register application classes (LastError: %d)!\n", GetLastError());
if (RegisterApplicationClasses())
{
hMainWnd = CreateApplicationWindow();
if (hMainWnd != NULL)
{
BOOL bRet;
while ((bRet =GetMessage(&Msg,
NULL,
0,
0)) != 0)
{
if (bRet != -1)
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
}
DestroyWindow(hMainWnd);
Ret = 0;
}
else
{
DPRINT("Failed to create application window (LastError: %d)!\n", GetLastError());
}
UnregisterApplicationClasses();
}
else
{
DPRINT("Failed to register application classes (LastError: %d)!\n", GetLastError());
}
}
if (lpAppTitle != NULL)

View file

@ -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 */

View file

@ -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@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 */