[MMSYS] Volume page: Initialize the volume trackbar before it might be disabled becau...
authorEric Kohl <eric.kohl@reactos.org>
Sun, 24 Feb 2019 16:15:13 +0000 (17:15 +0100)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 24 Feb 2019 16:15:13 +0000 (17:15 +0100)
dll/cpl/mmsys/volume.c

index a64642f..4c3189b 100644 (file)
@@ -301,6 +301,10 @@ InitVolumeControls(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
 
     LoadString(hApplet, IDS_NO_DEVICES, szNoDevices, _countof(szNoDevices));
 
+    SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(VOLUME_MIN, VOLUME_MAX));
+    SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETTICFREQ, VOLUME_TICFREQ, 0);
+    SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETPAGESIZE, 0, VOLUME_PAGESIZE);
+
     NumMixers = mixerGetNumDevs();
     if (!NumMixers)
     {
@@ -351,9 +355,6 @@ InitVolumeControls(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
     GetVolumeValue(pGlobalData);
 
     SendDlgItemMessage(hwndDlg, IDC_DEVICE_NAME, WM_SETTEXT, 0, (LPARAM)mxc.szPname);
-    SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(VOLUME_MIN, VOLUME_MAX));
-    SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETTICFREQ, VOLUME_TICFREQ, 0);
-    SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETPAGESIZE, 0, VOLUME_PAGESIZE);
     SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)(pGlobalData->maxVolume - pGlobalData->volumeMinimum) / pGlobalData->volumeStep);
 }