Commit 0e1cbfd5 authored by Andreas Mohr's avatar Andreas Mohr Committed by Alexandre Julliard

Updated to not rely on rundll32.exe any more.

parent 69249675
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
void launch(char what[255]) void launch(char what[255])
{ {
HINSTANCE hChild; HMODULE hMod;
char szArgs[255]; FARPROC pControl_RunDLL;
lstrcpy(szArgs, szEXEC_ARGS); hMod = LoadLibrary("shell32.dll");
strcat(szArgs, what); pControl_RunDLL = GetProcAddress(hMod, "Control_RunDLL");
pControl_RunDLL(GetDesktopWindow(), 0, what, SW_SHOW);
hChild = ShellExecute((HWND)0, 0, szEXEC_PREFIX, szArgs, "", SW_SHOWNORMAL); FreeLibrary(hMod);
exit(0); exit(0);
} }
...@@ -35,18 +35,27 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, CHAR *szParam, INT argc) ...@@ -35,18 +35,27 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, CHAR *szParam, INT argc)
break; break;
case 1: /* check for optional parameter */ case 1: /* check for optional parameter */
if (strcmp(szParams,szP_DESKTOP) ==0) launch(szC_DESKTOP); if (!strcmp(szParams,szP_DESKTOP))
if (strcmp(szParams,szP_COLOR) ==0) launch(szC_COLOR); launch(szC_DESKTOP);
if (strcmp(szParams,szP_DATETIME) ==0) launch(szC_DATETIME); if (!strcmp(szParams,szP_COLOR))
if (strcmp(szParams,szP_DESKTOP) ==0) launch(szC_DESKTOP); launch(szC_COLOR);
if (strcmp(szParams,szP_INTERNATIONAL)==0) launch(szC_INTERNATIONAL); if (!strcmp(szParams,szP_DATETIME))
if (strcmp(szParams,szP_KEYBOARD) ==0) launch(szC_KEYBOARD); launch(szC_DATETIME);
if (strcmp(szParams,szP_MOUSE) ==0) launch(szC_MOUSE); if (!strcmp(szParams,szP_DESKTOP))
if (strcmp(szParams,szP_PORTS) ==0) launch(szC_PORTS); launch(szC_DESKTOP);
if (strcmp(szParams,szP_PRINTERS) ==0) launch(szC_PRINTERS); if (!strcmp(szParams,szP_INTERNATIONAL))
launch(szC_INTERNATIONAL);
/* couldn't recognize desired panel, going default mode */ if (!strcmp(szParams,szP_KEYBOARD))
launch(""); launch(szC_KEYBOARD);
if (!strcmp(szParams,szP_MOUSE))
launch(szC_MOUSE);
if (!strcmp(szParams,szP_PORTS))
launch(szC_PORTS);
if (!strcmp(szParams,szP_PRINTERS))
launch(szC_PRINTERS);
/* try to launch if a .cpl file is given directly */
launch(szParams);
break; break;
default: printf("Syntax error."); default: printf("Syntax error.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment