Fix processing of the command line.
This commit is contained in:
parent
16cd86197a
commit
1341e9ae2b
|
@ -30,19 +30,19 @@ void launch(const char *what)
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, CHAR *szParam, INT argc)
|
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszCmdLine, INT nCmdShow)
|
||||||
{
|
{
|
||||||
|
|
||||||
char szParams[255];
|
char szParams[255];
|
||||||
lstrcpy(szParams, szParam);
|
lstrcpy(szParams, lpszCmdLine);
|
||||||
CharUpper(szParams);
|
CharUpper(szParams);
|
||||||
|
|
||||||
switch (argc) {
|
/* no parameters - pop up whole "Control Panel" by default */
|
||||||
case 0: /* no parameters - pop up whole "Control Panel" by default */
|
if (!*szParams) {
|
||||||
launch("");
|
launch("");
|
||||||
break;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
case 1: /* check for optional parameter */
|
/* check for optional parameter */
|
||||||
if (!strcmp(szParams,szP_DESKTOP))
|
if (!strcmp(szParams,szP_DESKTOP))
|
||||||
launch(szC_DESKTOP);
|
launch(szC_DESKTOP);
|
||||||
if (!strcmp(szParams,szP_COLOR))
|
if (!strcmp(szParams,szP_COLOR))
|
||||||
|
@ -64,9 +64,5 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, CHAR *szParam, INT argc)
|
||||||
|
|
||||||
/* try to launch if a .cpl file is given directly */
|
/* try to launch if a .cpl file is given directly */
|
||||||
launch(szParams);
|
launch(szParams);
|
||||||
break;
|
|
||||||
|
|
||||||
default: printf("Syntax error.");
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue