ReactOS 0.4.15-dev-5893-g1bb4167
mmsys.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <wingdi.h>
#include <winuser.h>
#include <mmsystem.h>
#include <cpl.h>
#include <setupapi.h>
#include <stdlib.h>
#include <strsafe.h>
#include "resource.h"
Include dependency graph for mmsys.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _APPLET
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define CONST_STR_LEN(str)   (_countof(str) - 1)
 
#define DRVM_MAPPER   0x2000
 
#define DRVM_MAPPER_PREFERRED_GET   (DRVM_MAPPER + 21)
 
#define DRVM_MAPPER_PREFERRED_SET   (DRVM_MAPPER + 22)
 
#define VOLUME_MIN   0
 
#define VOLUME_MAX   500
 
#define VOLUME_TICFREQ   50
 
#define VOLUME_PAGESIZE   100
 

Typedefs

typedef struct _APPLET APPLET
 
typedef struct _APPLETPAPPLET
 

Functions

VOID InitPropSheetPage (PROPSHEETPAGEW *psp, WORD idDlg, DLGPROC DlgProc)
 
LONG APIENTRY MmSysApplet (HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK SoundsDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK VolumeDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK VoiceDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK AudioDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR SpeakerVolume (HWND hwndDlg)
 

Variables

HINSTANCE hApplet
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 7 of file mmsys.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 8 of file mmsys.h.

◆ CONST_STR_LEN

#define CONST_STR_LEN (   str)    (_countof(str) - 1)

Definition at line 23 of file mmsys.h.

◆ DRVM_MAPPER

#define DRVM_MAPPER   0x2000

Definition at line 38 of file mmsys.h.

◆ DRVM_MAPPER_PREFERRED_GET

#define DRVM_MAPPER_PREFERRED_GET   (DRVM_MAPPER + 21)

Definition at line 39 of file mmsys.h.

◆ DRVM_MAPPER_PREFERRED_SET

#define DRVM_MAPPER_PREFERRED_SET   (DRVM_MAPPER + 22)

Definition at line 40 of file mmsys.h.

◆ VOLUME_MAX

#define VOLUME_MAX   500

Definition at line 43 of file mmsys.h.

◆ VOLUME_MIN

#define VOLUME_MIN   0

Definition at line 42 of file mmsys.h.

◆ VOLUME_PAGESIZE

#define VOLUME_PAGESIZE   100

Definition at line 45 of file mmsys.h.

◆ VOLUME_TICFREQ

#define VOLUME_TICFREQ   50

Definition at line 44 of file mmsys.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 6 of file mmsys.h.

Typedef Documentation

◆ APPLET

◆ PAPPLET

typedef struct _APPLET * PAPPLET

Function Documentation

◆ AudioDlgProc()

INT_PTR CALLBACK AudioDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 241 of file audio.c.

245{
246 PGLOBAL_DATA pGlobalData;
247
248 pGlobalData = (PGLOBAL_DATA)GetWindowLongPtrW(hwndDlg, DWLP_USER);
249
250 switch (uMsg)
251 {
252 case WM_INITDIALOG:
253 {
254 UINT NumWavOut = waveOutGetNumDevs();
255
256 pGlobalData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLOBAL_DATA));
257 SetWindowLongPtrW(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
258
259 if (!pGlobalData)
260 break;
261
262 InitAudioDlg(hwndDlg, pGlobalData);
263
264 if (!NumWavOut)
265 {
276 }
277
278 if (pGlobalData->bNoAudioOut)
279 {
283 }
284
285 if (pGlobalData->bNoAudioIn)
286 {
290 }
291
292 if (pGlobalData->bNoMIDIOut)
293 {
297 }
298 }
299 break;
300
301 case WM_COMMAND:
302 {
303 STARTUPINFOW si;
306
307 if (!pGlobalData)
308 break;
309
310 switch (LOWORD(wParam))
311 {
312 case IDC_VOLUME1_BTN:
313 {
314 StringCchPrintfW(szPath, _countof(szPath), L"sndvol32.exe -d %d",
316
317 ZeroMemory(&si, sizeof(si));
318 si.cb = sizeof(si);
320 si.wShowWindow = SW_SHOW;
321
322 if (CreateProcessW(NULL, szPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
323 {
324 CloseHandle(pi.hProcess);
325 CloseHandle(pi.hThread);
326 }
327 }
328 break;
329
330 case IDC_ADV2_BTN:
331 {
332
333 }
334 break;
335
336 case IDC_VOLUME2_BTN:
337 {
338 StringCchPrintfW(szPath, _countof(szPath), L"sndvol32.exe -r -d %d",
340
341 ZeroMemory(&si, sizeof(si));
342 si.cb = sizeof(si);
344 si.wShowWindow = SW_SHOW;
345
346 if (CreateProcessW(NULL, szPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
347 {
348 CloseHandle(pi.hProcess);
349 CloseHandle(pi.hThread);
350 }
351 }
352 break;
353
354 case IDC_ADV1_BTN:
355 {
356
357 }
358 break;
359
360 case IDC_VOLUME3_BTN:
361 {
362 StringCchPrintfW(szPath, _countof(szPath), L"sndvol32.exe -d %d",
364
365 ZeroMemory(&si, sizeof(si));
366 si.cb = sizeof(si);
368 si.wShowWindow = SW_SHOW;
369
370 if (CreateProcessW(NULL, szPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
371 {
372 CloseHandle(pi.hProcess);
373 CloseHandle(pi.hThread);
374 }
375 }
376 break;
377
378 case IDC_ADV3_BTN:
379 {
380
381 }
382 break;
383
385 {
387 {
388 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
389 pGlobalData->bAudioOutChanged = TRUE;
390 }
391 }
392 break;
393
395 {
397 {
398 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
399 pGlobalData->bAudioInChanged = TRUE;
400 }
401 }
402
404 {
406 {
407 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
408 pGlobalData->bMIDIOutChanged = TRUE;
409 }
410 }
411 break;
412 }
413 }
414 break;
415
416 case WM_DESTROY:
417 if (!pGlobalData)
418 break;
419
420 HeapFree(GetProcessHeap(), 0, pGlobalData);
421 break;
422
423 case WM_NOTIFY:
424 if (!pGlobalData)
425 break;
426
427 if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
428 {
429 SaveAudioDlg(hwndDlg, pGlobalData);
430 }
431 return TRUE;
432 }
433
434 return FALSE;
435}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
VOID InitAudioDlg(HWND hwnd, PGLOBAL_DATA pGlobalData)
Definition: audio.c:26
static UINT GetDevNum(HWND hControl, DWORD Id)
Definition: audio.c:219
struct _GLOBAL_DATA * PGLOBAL_DATA
VOID SaveAudioDlg(HWND hwnd, PGLOBAL_DATA pGlobalData)
Definition: audio.c:191
#define IDC_VOLUME1_BTN
Definition: resource.h:55
#define IDC_DEFAULT_DEV_CHECKBOX
Definition: resource.h:41
#define IDC_DEVICE_MIDI_LIST
Definition: resource.h:44
#define IDC_DEVICE_REC_LIST
Definition: resource.h:43
#define IDC_VOLUME3_BTN
Definition: resource.h:59
#define IDC_ADV2_BTN
Definition: resource.h:56
#define IDC_VOLUME2_BTN
Definition: resource.h:57
#define IDC_ADV3_BTN
Definition: resource.h:60
#define IDC_DEVICE_PLAY_LIST
Definition: resource.h:42
#define IDC_ADV1_BTN
Definition: resource.h:58
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4593
#define MIXER_OBJECTF_MIDIOUT
Definition: mmsystem.h:306
#define MIXER_OBJECTF_WAVEOUT
Definition: mmsystem.h:302
#define MIXER_OBJECTF_WAVEIN
Definition: mmsystem.h:304
LPCWSTR szPath
Definition: env.c:37
static refpint_t pi[]
Definition: server.c:96
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_APPLY
Definition: prsht.h:117
#define WM_NOTIFY
Definition: richedit.h:61
#define _countof(array)
Definition: sndvol32.h:68
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
BOOL bMIDIOutChanged
Definition: audio.c:21
BOOL bAudioOutChanged
Definition: audio.c:19
BOOL bNoAudioIn
Definition: audio.c:16
BOOL bAudioInChanged
Definition: audio.c:20
BOOL bNoAudioOut
Definition: audio.c:15
BOOL bNoMIDIOut
Definition: audio.c:17
DWORD cb
Definition: winbase.h:852
DWORD dwFlags
Definition: winbase.h:863
WORD wShowWindow
Definition: winbase.h:864
Definition: inflate.c:139
#define HIWORD(l)
Definition: typedefs.h:247
#define ZeroMemory
Definition: winbase.h:1670
#define STARTF_USESHOWWINDOW
Definition: winbase.h:491
UINT WINAPI waveOutGetNumDevs(void)
Definition: winmm.c:2140
#define DWLP_USER
Definition: winuser.h:866
#define GetWindowLongPtrW
Definition: winuser.h:4819
#define WM_COMMAND
Definition: winuser.h:1730
#define WM_INITDIALOG
Definition: winuser.h:1729
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define CBN_SELCHANGE
Definition: winuser.h:1969
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define SW_SHOW
Definition: winuser.h:769
#define WM_DESTROY
Definition: winuser.h:1599
#define SetWindowLongPtrW
Definition: winuser.h:5336
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by MmSysApplet(), ShowAudioPropertySheet(), and ShowFullControlPanel().

◆ InitPropSheetPage()

VOID InitPropSheetPage ( PROPSHEETPAGEW psp,
WORD  idDlg,
DLGPROC  DlgProc 
)

Definition at line 728 of file mmsys.c.

731{
732 ZeroMemory(psp, sizeof(PROPSHEETPAGEW));
733 psp->dwSize = sizeof(PROPSHEETPAGEW);
734 psp->dwFlags = PSP_DEFAULT;
735 psp->hInstance = hApplet;
737 psp->pfnDlgProc = DlgProc;
738}
WORD idDlg
Definition: desk.c:110
DLGPROC DlgProc
Definition: desk.c:111
HINSTANCE hApplet
Definition: mmsys.c:103
#define PSP_DEFAULT
Definition: prsht.h:22
struct _PROPSHEETPAGEW PROPSHEETPAGEW
DLGPROC pfnDlgProc
Definition: prsht.h:226
DWORD dwSize
Definition: prsht.h:214
DWORD dwFlags
Definition: prsht.h:215
LPCWSTR pszTemplate
Definition: prsht.h:218
HINSTANCE hInstance
Definition: prsht.h:216
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by MmSysApplet(), ShowAudioPropertySheet(), and ShowFullControlPanel().

◆ MmSysApplet()

LONG APIENTRY MmSysApplet ( HWND  hwnd,
UINT  uMsg,
LPARAM  wParam,
LPARAM  lParam 
)

Definition at line 690 of file mmsys.c.

694{
695 PROPSHEETPAGEW psp[5];
696 PROPSHEETHEADERW psh; // = { 0 };
697 INT nPage = 0;
698
700
701 if (uMsg == CPL_STARTWPARMSW && lParam != 0)
702 nPage = _wtoi((PWSTR)lParam);
703
704 psh.dwSize = sizeof(PROPSHEETHEADERW);
706 psh.hwndParent = hwnd;
707 psh.hInstance = hApplet;
710 psh.nPages = _countof(psp);
711 psh.nStartPage = 0;
712 psh.ppsp = psp;
714
720
721 if (nPage != 0 && nPage <= psh.nPages)
722 psh.nStartPage = nPage;
723
724 return (LONG)(PropertySheetW(&psh) != -1);
725}
#define CPL_STARTWPARMSW
Definition: cpl.h:21
#define IDS_CPLNAME
Definition: resource.h:8
#define IDI_CPLICON
Definition: resource.h:4
#define IDD_HARDWARE
Definition: resource.h:29
INT_PTR CALLBACK AudioDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: audio.c:241
#define IDD_VOLUME
Definition: resource.h:19
#define IDD_VOICE
Definition: resource.h:22
#define IDD_AUDIO
Definition: resource.h:21
#define IDD_SOUNDS
Definition: resource.h:20
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2905
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
static INT_PTR CALLBACK HardwareDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: mmsys.c:645
VOID InitPropSheetPage(PROPSHEETPAGEW *psp, WORD idDlg, DLGPROC DlgProc)
Definition: mmsys.c:728
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: mmsys.c:673
INT_PTR CALLBACK SoundsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: sounds.c:1146
INT_PTR CALLBACK VolumeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: volume.c:388
INT_PTR CALLBACK VoiceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: voice.c:15
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
long LONG
Definition: pedump.c:60
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define PSH_USEICONID
Definition: prsht.h:42
struct _PROPSHEETHEADERW PROPSHEETHEADERW
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:308
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
LPCWSTR pszIcon
Definition: prsht.h:299
HWND hwndParent
Definition: prsht.h:295
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
UINT nStartPage
Definition: prsht.h:304
LPCWSTR pszCaption
Definition: prsht.h:301
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ SoundsDlgProc()

INT_PTR CALLBACK SoundsDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Should store in current member

Definition at line 1146 of file sounds.c.

1150{
1151 PGLOBAL_DATA pGlobalData;
1152
1155 WCHAR szFilter[256], szTitle[256];
1156 LPWSTR pFileName;
1157 LRESULT lResult;
1158
1159 pGlobalData = (PGLOBAL_DATA)GetWindowLongPtrW(hwndDlg, DWLP_USER);
1160
1161 switch (uMsg)
1162 {
1163 case WM_INITDIALOG:
1164 {
1166 SetWindowLongPtrW(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
1167
1168 pGlobalData->NumWavOut = waveOutGetNumDevs();
1169
1173
1178 IMAGE_ICON);
1179
1180 LoadEventLabels(pGlobalData);
1181 LoadSoundProfiles(pGlobalData, hwndDlg);
1182 LoadSoundFiles(hwndDlg);
1183 ShowSoundScheme(pGlobalData, hwndDlg);
1184
1185 if (wParam == (WPARAM)GetDlgItem(hwndDlg, IDC_SOUND_SCHEME))
1186 return TRUE;
1188 return FALSE;
1189 }
1190 case WM_COMMAND:
1191 {
1192 switch (LOWORD(wParam))
1193 {
1194 case IDC_BROWSE_SOUND:
1195 {
1196 ZeroMemory(&ofn, sizeof(ofn));
1197 ofn.lStructSize = sizeof(ofn);
1198 ofn.hwndOwner = hwndDlg;
1204 ofn.nFilterIndex = 0;
1207 ofn.lpstrInitialDir = L"%SystemRoot%\\Media";
1209
1210 if (GetOpenFileNameW(&ofn))
1211 {
1212 // search if list already contains that sound
1213 lResult = FindSoundFileInList(hwndDlg, filename);
1214 if (lResult != CB_ERR)
1215 {
1216 SendDlgItemMessageW(hwndDlg, IDC_SOUND_LIST, CB_SETCURSEL, (WPARAM)lResult, 0);
1217 break;
1218 }
1219
1220 // extract file name
1221 pFileName = wcsrchr(filename, L'\\');
1222 ASSERT(pFileName != NULL);
1223 pFileName++;
1224
1225 // add to list
1226 lResult = SendDlgItemMessageW(hwndDlg, IDC_SOUND_LIST, CB_ADDSTRING, 0, (LPARAM)pFileName);
1227 if (lResult != CB_ERR)
1228 {
1229 // add path and select item
1231 SendDlgItemMessageW(hwndDlg, IDC_SOUND_LIST, CB_SETCURSEL, (WPARAM)lResult, 0);
1232 }
1233 }
1234 break;
1235 }
1236 case IDC_PLAY_SOUND:
1237 {
1238 LRESULT lIndex;
1239 lIndex = ComboBox_GetCurSel(GetDlgItem(hwndDlg, IDC_SOUND_LIST));
1240 if (lIndex == CB_ERR)
1241 {
1242 break;
1243 }
1244
1245 lIndex = ComboBox_GetItemData(GetDlgItem(hwndDlg, IDC_SOUND_LIST), lIndex);
1246 if (lIndex != CB_ERR)
1247 {
1249 }
1250 break;
1251 }
1252 case IDC_SOUND_SCHEME:
1253 {
1254 if (HIWORD(wParam) == CBN_SELENDOK)
1255 {
1257 ShowSoundScheme(pGlobalData, hwndDlg);
1262 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1263 }
1264 break;
1265 }
1266 case IDC_SOUND_LIST:
1267 {
1268 if (HIWORD(wParam) == CBN_SELENDOK)
1269 {
1270 PLABEL_CONTEXT pLabelContext;
1272 TVITEMW item;
1273 LRESULT lIndex;
1274
1276 if (hItem == NULL)
1277 {
1278 break;
1279 }
1280
1281 lIndex = ComboBox_GetCurSel(GetDlgItem(hwndDlg, IDC_SOUND_LIST));
1282 if (lIndex == CB_ERR)
1283 {
1284 break;
1285 }
1286
1287 ZeroMemory(&item, sizeof(item));
1288 item.mask = TVIF_PARAM;
1289 item.hItem = hItem;
1291 {
1292 LRESULT lResult;
1293 pLabelContext = (PLABEL_CONTEXT)item.lParam;
1294
1295 lResult = ComboBox_GetItemData(GetDlgItem(hwndDlg, IDC_SOUND_LIST), lIndex);
1296 if (lResult == CB_ERR || lResult == 0)
1297 {
1298 if (lIndex != pLabelContext->szValue[0])
1299 {
1300 /* Update the tree view item image */
1302 item.iImage = IMAGE_SOUND_NONE;
1303 item.iSelectedImage = IMAGE_SOUND_NONE;
1305
1306 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1307
1309 }
1310
1311 pLabelContext->szValue[0] = UNICODE_NULL;
1312
1313 break;
1314 }
1315
1316 if (_wcsicmp(pLabelContext->szValue, (PWCHAR)lResult) || (lIndex != pLabelContext->szValue[0]))
1317 {
1318 /* Update the tree view item image */
1320 item.iImage = IMAGE_SOUND_ASSIGNED;
1321 item.iSelectedImage = IMAGE_SOUND_ASSIGNED;
1323
1324 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1325
1329 StringCchCopyW(pLabelContext->szValue, _countof(pLabelContext->szValue), (PWCHAR)lResult);
1330 }
1331
1332 if (wcslen((PWCHAR)lResult) && lIndex != 0 && pGlobalData->NumWavOut != 0)
1333 {
1335 }
1336 else
1337 {
1339 }
1340 }
1341 }
1342 break;
1343 }
1344 }
1345 break;
1346 }
1347 case WM_DESTROY:
1348 {
1349 FreeSoundFiles(hwndDlg);
1350 FreeSoundProfiles(hwndDlg);
1351 FreeAppMap(pGlobalData);
1352 FreeLabelMap(pGlobalData);
1353 if (pGlobalData->hSoundsImageList)
1354 ImageList_Destroy(pGlobalData->hSoundsImageList);
1355 HeapFree(GetProcessHeap(), 0, pGlobalData);
1356 break;
1357 }
1358 case WM_NOTIFY:
1359 {
1360 PLABEL_CONTEXT pLabelContext;
1361 PWCHAR ptr;
1362
1363 LPNMHDR lpnm = (LPNMHDR)lParam;
1364
1365 switch (lpnm->code)
1366 {
1367 case PSN_APPLY:
1368 {
1369 ApplyChanges(hwndDlg);
1370 break;
1371 }
1372 case TVN_SELCHANGED:
1373 {
1375 LRESULT lCount, lIndex, lResult;
1376
1377 pLabelContext = (PLABEL_CONTEXT)nm->itemNew.lParam;
1378 if (pLabelContext == NULL)
1379 {
1384 return FALSE;
1385 }
1386
1390
1391 if (wcslen(pLabelContext->szValue) == 0)
1392 {
1393 lIndex = ComboBox_SetCurSel(GetDlgItem(hwndDlg, IDC_SOUND_LIST), 0);
1395 break;
1396 }
1397
1398 if (pGlobalData->NumWavOut != 0)
1400
1401 lCount = ComboBox_GetCount(GetDlgItem(hwndDlg, IDC_SOUND_LIST));
1402 for (lIndex = 0; lIndex < lCount; lIndex++)
1403 {
1404 lResult = ComboBox_GetItemData(GetDlgItem(hwndDlg, IDC_SOUND_LIST), lIndex);
1405 if (lResult == CB_ERR || lResult == 0)
1406 continue;
1407
1408 if (!wcscmp((PWCHAR)lResult, pLabelContext->szValue))
1409 {
1410 ComboBox_SetCurSel(GetDlgItem(hwndDlg, IDC_SOUND_LIST), lIndex);
1411 return FALSE;
1412 }
1413 }
1414
1415 ptr = wcsrchr(pLabelContext->szValue, L'\\');
1416 if (ptr)
1417 {
1418 ptr++;
1419 }
1420 else
1421 {
1422 ptr = pLabelContext->szValue;
1423 }
1424
1425 lIndex = ComboBox_AddString(GetDlgItem(hwndDlg, IDC_SOUND_LIST), ptr);
1426 if (lIndex != CB_ERR)
1427 {
1428 ComboBox_SetItemData(GetDlgItem(hwndDlg, IDC_SOUND_LIST), lIndex, _wcsdup(pLabelContext->szValue));
1429 ComboBox_SetCurSel(GetDlgItem(hwndDlg, IDC_SOUND_LIST), lIndex);
1430 }
1431 break;
1432 }
1433 }
1434 }
1435 break;
1436 }
1437
1438 return FALSE;
1439}
#define OFN_EXPLORER
Definition: commdlg.h:104
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
HINSTANCE hApplet
Definition: access.c:17
#define IDI_SOUND_ASSIGNED
Definition: resource.h:11
#define IDC_SOUND_LIST
Definition: resource.h:40
#define IDI_PLAY_ICON
Definition: resource.h:5
#define IDI_SOUND_SECTION
Definition: resource.h:10
#define IMAGE_SOUND_NONE
Definition: resource.h:96
#define IDC_TEXT_SOUND
Definition: resource.h:47
#define IDC_PLAY_SOUND
Definition: resource.h:48
#define IDC_SOUND_SCHEME
Definition: resource.h:38
#define IMAGE_SOUND_ASSIGNED
Definition: resource.h:95
#define IDS_WAVE_FILES_FILTER
Definition: resource.h:85
#define IDC_SCHEME_LIST
Definition: resource.h:39
#define IDS_BROWSE_FOR_SOUND
Definition: resource.h:84
#define IDC_BROWSE_SOUND
Definition: resource.h:49
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
BOOL WINAPI GetOpenFileNameW(OPENFILENAMEW *ofn)
Definition: filedlg.c:4677
#define wcsrchr
Definition: compat.h:16
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
const char * filename
Definition: ioapi.h:137
if(dx< 0)
Definition: linetemp.h:194
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define SND_FILENAME
Definition: mmsystem.h:162
#define ASSERT(a)
Definition: mode.c:44
static PVOID ptr
Definition: dispmode.c:27
static ATOM item
Definition: dde.c:856
LPTSTR szFilter
Definition: mplay32.c:30
#define UNICODE_NULL
BOOL WINAPI PlaySoundW(LPCWSTR pszSoundW, HMODULE hmod, DWORD fdwSound)
Definition: playsound.c:531
#define TVN_SELCHANGED
Definition: commctrl.h:3735
#define TreeView_DeleteAllItems(hwnd)
Definition: commctrl.h:3417
#define TVIF_IMAGE
Definition: commctrl.h:3267
struct tagNMTREEVIEWW * LPNMTREEVIEWW
#define TreeView_GetSelection(hwnd)
Definition: commctrl.h:3473
#define TreeView_GetItem(hwnd, pitem)
Definition: commctrl.h:3490
#define TVIF_PARAM
Definition: commctrl.h:3268
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3271
#define TreeView_SetItem(hwnd, pitem)
Definition: commctrl.h:3497
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP wchar_t *__cdecl _wcsdup(_In_z_ const wchar_t *_Str)
OPENFILENAME ofn
Definition: sndrec32.cpp:56
struct _GLOBAL_DATA GLOBAL_DATA
BOOL LoadSoundFiles(HWND hwndDlg)
Definition: sounds.c:812
HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height, ULONG type)
Definition: sounds.c:1083
LPWSTR MakeFilter(LPWSTR psz)
Definition: sounds.c:64
static LRESULT FindSoundFileInList(HWND hwndDlg, LPCWSTR pSoundPath)
Definition: sounds.c:901
BOOL LoadEventLabels(PGLOBAL_DATA pGlobalData)
Definition: sounds.c:301
static VOID FreeAppMap(PGLOBAL_DATA pGlobalData)
Definition: sounds.c:188
static VOID FreeSoundProfiles(HWND hwndDlg)
Definition: sounds.c:498
struct _LABEL_CONTEXT * PLABEL_CONTEXT
BOOL ApplyChanges(HWND hwndDlg)
Definition: sounds.c:1014
struct _GLOBAL_DATA * PGLOBAL_DATA
static VOID FreeLabelMap(PGLOBAL_DATA pGlobalData)
Definition: sounds.c:149
BOOL LoadSoundProfiles(PGLOBAL_DATA pGlobalData, HWND hwndDlg)
Definition: sounds.c:784
BOOL ShowSoundScheme(PGLOBAL_DATA pGlobalData, HWND hwndDlg)
Definition: sounds.c:927
static VOID FreeSoundFiles(HWND hwndDlg)
Definition: sounds.c:875
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
HIMAGELIST hSoundsImageList
Definition: sounds.c:56
UINT NumWavOut
Definition: sounds.c:59
WCHAR szValue[MAX_PATH]
Definition: sounds.c:42
UINT code
Definition: winuser.h:3149
TVITEMW itemNew
Definition: commctrl.h:3638
DWORD nFilterIndex
Definition: commdlg.h:335
HWND hwndOwner
Definition: commdlg.h:330
LPCSTR lpstrTitle
Definition: commdlg.h:341
LPSTR lpstrFile
Definition: commdlg.h:336
DWORD Flags
Definition: commdlg.h:342
LPCSTR lpstrInitialDir
Definition: commdlg.h:340
DWORD lStructSize
Definition: commdlg.h:329
LPCSTR lpstrFilter
Definition: commdlg.h:332
DWORD nMaxFile
Definition: commdlg.h:337
LPARAM lParam
Definition: commctrl.h:3325
HTREEITEM hItem
Definition: treelist.h:37
uint16_t * PWCHAR
Definition: typedefs.h:56
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define ComboBox_SetCurSel(hwndCtl, index)
Definition: windowsx.h:66
#define ComboBox_GetItemData(hwndCtl, index)
Definition: windowsx.h:54
#define ComboBox_GetCount(hwndCtl)
Definition: windowsx.h:48
#define ComboBox_GetCurSel(hwndCtl)
Definition: windowsx.h:49
#define ComboBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:41
#define ComboBox_SetItemData(hwndCtl, index, data)
Definition: windowsx.h:69
#define CB_SETITEMDATA
Definition: winuser.h:1956
#define IMAGE_ICON
Definition: winuser.h:212
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define CB_ERR
Definition: winuser.h:2425
#define CB_SETCURSEL
Definition: winuser.h:1951
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BM_SETIMAGE
Definition: winuser.h:1912
#define SM_CXSMICON
Definition: winuser.h:1006
HWND WINAPI SetFocus(_In_opt_ HWND)
#define CB_ADDSTRING
Definition: winuser.h:1926
struct tagNMHDR * LPNMHDR
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define CBN_SELENDOK
Definition: winuser.h:1971
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by MmSysApplet(), and ShowFullControlPanel().

◆ SpeakerVolume()

INT_PTR SpeakerVolume ( HWND  hwndDlg)

Definition at line 304 of file speakervolume.c.

306{
307 PROPSHEETPAGEW psp[1];
309
310 ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
311 psh.dwSize = sizeof(PROPSHEETHEADERW);
313 psh.hwndParent = hwndDlg;
314 psh.hInstance = hApplet;
316 psh.nPages = _countof(psp);
317 psh.nStartPage = 0;
318 psh.ppsp = psp;
319
321 psp[0].dwFlags |= PSP_USETITLE;
322 psp[0].hInstance = hApplet;
324
325 return (LONG)(PropertySheetW(&psh) != -1);
326}
static VOID InitPropSheetPage(PROPSHEETPAGE *psp, PSERVICEPROPSHEET dlgInfo, WORD idDlg, DLGPROC DlgProc)
Definition: propsheet.c:15
#define IDS_SPEAKER_VOLUME
Definition: resource.h:73
#define IDD_MULTICHANNEL
Definition: resource.h:29
#define PSP_USETITLE
Definition: prsht.h:26
INT_PTR CALLBACK SpeakerVolumeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
LPCWSTR pszTitle
Definition: prsht.h:225
#define MAKEINTRESOURCE
Definition: winuser.h:591

Referenced by VolumeDlgProc().

◆ VoiceDlgProc()

INT_PTR CALLBACK VoiceDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 15 of file voice.c.

19{
22 switch (uMsg)
23 {
24 case WM_INITDIALOG:
25 {
26 UINT NumWavOut;
27
28 NumWavOut = waveOutGetNumDevs();
29 if (!NumWavOut)
30 {
38 }
39 }
40 break;
41 }
42
43 return FALSE;
44}
#define IDC_TEST_HARDWARE
Definition: resource.h:65
#define IDC_ADV5_BTN
Definition: resource.h:64
#define IDC_VOLUME4_BTN
Definition: resource.h:61
#define IDC_DEVICE_VOICE_LIST
Definition: resource.h:45
#define IDC_ADV4_BTN
Definition: resource.h:62
#define IDC_VOLUME5_BTN
Definition: resource.h:63
#define IDC_DEVICE_VOICE_REC_LIST
Definition: resource.h:46

Referenced by MmSysApplet(), and ShowFullControlPanel().

◆ VolumeDlgProc()

INT_PTR CALLBACK VolumeDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 388 of file volume.c.

392{
393 static const INT speakImgSize[] = {72, 72};
394 PGLOBAL_DATA pGlobalData;
395
396 pGlobalData = (PGLOBAL_DATA)GetWindowLongPtrW(hwndDlg, DWLP_USER);
397
398 switch (uMsg)
399 {
401 {
402 GetMuteState(pGlobalData);
403 if (pGlobalData->muteVal)
404 {
407 }
408 else
409 {
412 }
413 break;
414 }
416 {
417 GetVolumeValue(pGlobalData, FALSE);
418 SendDlgItemMessageW(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)(pGlobalData->maxVolume - pGlobalData->volumeMinimum) / pGlobalData->volumeStep);
419 break;
420 }
421 case WM_INITDIALOG:
422 {
424 SetWindowLongPtrW(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
425
429 pGlobalData->hIconSpeakImg = LoadImageW(hApplet,
432 speakImgSize[0],
433 speakImgSize[1],
435
436 InitVolumeControls(hwndDlg, pGlobalData);
437 break;
438 }
439
440 case WM_DRAWITEM:
441 {
442 LPDRAWITEMSTRUCT lpDrawItem;
443 lpDrawItem = (LPDRAWITEMSTRUCT)lParam;
444 if (lpDrawItem->CtlID == IDC_SPEAKIMG)
445 {
446 LONG left;
447
448 /* Position image in centre of dialog */
449 left = (lpDrawItem->rcItem.right - speakImgSize[0]) / 2;
450
451 DrawIconEx(lpDrawItem->hDC,
452 left,
453 lpDrawItem->rcItem.top,
454 pGlobalData->hIconSpeakImg,
455 speakImgSize[0],
456 speakImgSize[1],
457 0,
458 NULL,
459 DI_NORMAL);
460 }
461 break;
462 }
463
464 case WM_COMMAND:
465 {
466 switch (LOWORD(wParam))
467 {
469 if (HIWORD(wParam) == BN_CLICKED)
470 {
471 SwitchMuteState(pGlobalData);
472 if (pGlobalData->muteVal)
473 {
475 }
476 else
477 {
479 }
480
481 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
482 }
483 break;
484
486 if (HIWORD(wParam) == BN_CLICKED)
487 {
488 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
489 }
490 break;
491
492 case IDC_ADVANCED_BTN:
493 LaunchSoundControl(hwndDlg);
494 break;
495
497 SpeakerVolume(hwndDlg);
498 break;
499 }
500 break;
501 }
502
503 case WM_HSCROLL:
504 {
505 HWND hVolumeTrackbar = GetDlgItem(hwndDlg, IDC_VOLUME_TRACKBAR);
506 if (hVolumeTrackbar == (HWND)lParam)
507 {
508 switch (LOWORD(wParam))
509 {
510 case TB_THUMBPOSITION:
511 break;
512
513 case TB_ENDTRACK:
515 break;
516
517 default:
518 SetVolumeValue(pGlobalData,
520 break;
521 }
522 }
523 break;
524 }
525
526 case WM_DESTROY:
527 if (pGlobalData)
528 {
529 HeapFree(GetProcessHeap(), 0, pGlobalData->volumeCurrentValues);
530 HeapFree(GetProcessHeap(), 0, pGlobalData->volumePreviousValues);
531 HeapFree(GetProcessHeap(), 0, pGlobalData->volumeInitialValues);
532 mixerClose(pGlobalData->hMixer);
533
534 if (pGlobalData->hIconSpeakImg)
535 DestroyIcon(pGlobalData->hIconSpeakImg);
536
537 if (pGlobalData->hIconNoHW)
538 DestroyIcon(pGlobalData->hIconNoHW);
539
540 if (pGlobalData->hIconMuted)
541 DestroyIcon(pGlobalData->hIconMuted);
542
543 if (pGlobalData->hIconUnMuted)
544 DestroyIcon(pGlobalData->hIconUnMuted);
545
546 HeapFree(GetProcessHeap(), 0, pGlobalData);
547 }
548 break;
549
550 case WM_NOTIFY:
551 switch (((LPNMHDR)lParam)->code)
552 {
553 case PSN_APPLY:
554 SaveData(hwndDlg);
555 break;
556
557 case PSN_RESET:
558 RestoreVolumeValue(pGlobalData);
559 break;
560 }
561 return TRUE;
562 }
563
564 return FALSE;
565}
#define IDC_ICON_IN_TASKBAR
Definition: resource.h:37
#define IDC_MUTE_ICON
Definition: resource.h:71
#define IDI_NO_HW
Definition: resource.h:13
#define IDC_VOLUME_TRACKBAR
Definition: resource.h:33
#define IDC_SPEAKIMG
Definition: resource.h:70
#define IDC_ADVANCED_BTN
Definition: resource.h:51
#define IDI_MUTED_ICON
Definition: resource.h:14
#define IDC_SPEAKER_VOL_BTN
Definition: resource.h:53
#define IDC_MUTE_CHECKBOX
Definition: resource.h:36
#define IDI_SPEAKIMG
Definition: resource.h:69
struct _GLOBAL_DATA GLOBAL_DATA
VOID GetVolumeValue(PGLOBAL_DATA pGlobalData, BOOL bInit)
Definition: volume.c:172
VOID GetMuteState(PGLOBAL_DATA pGlobalData)
Definition: volume.c:73
static VOID RestoreVolumeValue(PGLOBAL_DATA pGlobalData)
Definition: volume.c:252
VOID SwitchMuteState(PGLOBAL_DATA pGlobalData)
Definition: volume.c:97
VOID InitVolumeControls(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
Definition: volume.c:302
struct _GLOBAL_DATA * PGLOBAL_DATA
VOID SetVolumeValue(PGLOBAL_DATA pGlobalData, DWORD dwPosition)
Definition: volume.c:208
VOID SaveData(HWND hwndDlg)
Definition: volume.c:368
VOID LaunchSoundControl(HWND hwndDlg)
Definition: volume.c:378
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint left
Definition: glext.h:7726
INT_PTR SpeakerVolume(HWND hwndDlg)
#define SND_ALIAS_SYSTEMDEFAULT
Definition: mmsystem.h:175
#define MM_MIXM_CONTROL_CHANGE
Definition: mmsystem.h:83
#define MM_MIXM_LINE_CHANGE
Definition: mmsystem.h:82
#define SND_ALIAS_ID
Definition: mmsystem.h:161
#define SND_ASYNC
Definition: mmsystem.h:154
#define PSN_RESET
Definition: prsht.h:118
#define TB_ENDTRACK
Definition: commctrl.h:2081
#define TB_THUMBPOSITION
Definition: commctrl.h:2077
#define TBM_GETPOS
Definition: commctrl.h:2031
#define TBM_SETPOS
Definition: commctrl.h:2036
HICON hIconMuted
Definition: volume.c:18
DWORD maxVolume
Definition: volume.c:32
PMIXERCONTROLDETAILS_UNSIGNED volumeCurrentValues
Definition: volume.c:35
HICON hIconNoHW
Definition: volume.c:20
LONG muteVal
Definition: volume.c:23
PMIXERCONTROLDETAILS_UNSIGNED volumePreviousValues
Definition: volume.c:34
HMIXER hMixer
Definition: volume.c:17
PMIXERCONTROLDETAILS_UNSIGNED volumeInitialValues
Definition: volume.c:33
HICON hIconSpeakImg
Definition: volume.c:21
HICON hIconUnMuted
Definition: volume.c:19
DWORD volumeMinimum
Definition: volume.c:28
DWORD volumeStep
Definition: volume.c:30
LONG right
Definition: windef.h:308
LONG top
Definition: windef.h:307
#define DI_NORMAL
Definition: wingdi.h:72
UINT WINAPI mixerClose(HMIXER hMix)
Definition: winmm.c:389
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
#define WM_HSCROLL
Definition: winuser.h:1733
#define BST_UNCHECKED
Definition: winuser.h:199
#define STM_SETIMAGE
Definition: winuser.h:2083
#define WM_DRAWITEM
Definition: winuser.h:1635
#define BM_SETCHECK
Definition: winuser.h:1911
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:1997
#define LR_DEFAULTCOLOR
Definition: winuser.h:1081
#define BN_CLICKED
Definition: winuser.h:1915
#define BST_CHECKED
Definition: winuser.h:197
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by MmSysApplet(), and ShowFullControlPanel().

Variable Documentation

◆ hApplet

HINSTANCE hApplet
extern

Definition at line 17 of file access.c.