Article ID: 175419
Article Last Modified on 7/12/2004
extern "C" VOID PASCAL ScheduleInstallation(HWND hwndParent,
HINSTANCE hDllInst,
LPSTR lpstrCmdLine, int nCmdShow)
{
HKEY hkPlugNPlay;
DWORD dw0 = 0;
/*
We now truncate lpstrCmdLine so it holds just the registry key we
need.
*/
for (LPSTR lpstrSource = lpstrCmdLine;
*lpstrSource && *lpstrSource != ' ';
lpstrSource++)
;
if (*lpstrSource) *lpstrSource++ ='\0';
if (ERROR_SUCCESS != RegOpenKey(HKEY_LOCAL_MACHINE, lpstrCmdLine,
&hkPlugNPlay))
{
return;
}
if (*lpstrSource) *(--lpstrSource) = ' '; // restore the blank
// We must mark as installed now, so we don't do all
// this once more in the event of a reboot.
RegSetValueEx(hkPlugNPlay, "ConfigFlags", 0, REG_BINARY, (LPBYTE)
&dw0, sizeof DWORD);
RegCloseKey(hkPlugNPlay);
BeginInstallation(hwndParent, hDllInst, lpstrCmdLine, nCmdShow);
return;
}
Keywords: kbhowto KB175419