Fix processing of the command line.

This commit is contained in:
Pavel Roskin 2003-09-25 20:21:32 +00:00 committed by Alexandre Julliard
parent 16cd86197a
commit 1341e9ae2b
1 changed files with 31 additions and 35 deletions

View File

@ -30,19 +30,19 @@ void launch(const char *what)
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];
lstrcpy(szParams, szParam);
lstrcpy(szParams, lpszCmdLine);
CharUpper(szParams);
switch (argc) {
case 0: /* no parameters - pop up whole "Control Panel" by default */
/* no parameters - pop up whole "Control Panel" by default */
if (!*szParams) {
launch("");
break;
return 0;
}
case 1: /* check for optional parameter */
/* check for optional parameter */
if (!strcmp(szParams,szP_DESKTOP))
launch(szC_DESKTOP);
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 */
launch(szParams);
break;
default: printf("Syntax error.");
}
return 0;
}