[MMSYS] Select a property page by command line, for expample 'control mmsys.cpl,,1'

This commit is contained in:
Eric Kohl 2020-02-11 05:40:59 +01:00
parent 9e53e7cd5b
commit 065a0bbf0f

View file

@ -715,11 +715,15 @@ MmSysApplet(HWND hwnd,
PROPSHEETPAGE psp[5];
PROPSHEETHEADER psh; // = { 0 };
TCHAR Caption[256];
INT nPage = 0;
UNREFERENCED_PARAMETER(lParam);
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(uMsg);
if (uMsg == CPL_STARTWPARMSW && lParam != 0)
nPage = _wtoi((PWSTR)lParam);
LoadString(hApplet, IDS_CPLNAME, Caption, _countof(Caption));
psh.dwSize = sizeof(PROPSHEETHEADER);
@ -739,6 +743,9 @@ MmSysApplet(HWND hwnd,
InitPropSheetPage(&psp[3], IDD_VOICE,VoiceDlgProc);
InitPropSheetPage(&psp[4], IDD_HARDWARE,HardwareDlgProc);
if (nPage != 0 && nPage <= psh.nPages)
psh.nStartPage = nPage;
return (LONG)(PropertySheet(&psh) != -1);
}
@ -792,6 +799,9 @@ CPlApplet(HWND hwndCpl,
lParam2);
break;
}
case CPL_STARTWPARMSW:
return Applets[(UINT)lParam1].AppletProc(hwndCpl, uMsg, lParam1, lParam2);
}
return FALSE;