Fix double-clicking control panel items
Modified: trunk/reactos/lib/shell32/cpanelfolder.c
Modified: trunk/reactos/lib/shell32/shlexec.c
_____
Modified: trunk/reactos/lib/shell32/cpanelfolder.c
--- trunk/reactos/lib/shell32/cpanelfolder.c 2005-09-08 20:53:17 UTC
(rev 17751)
+++ trunk/reactos/lib/shell32/cpanelfolder.c 2005-09-08 21:08:53 UTC
(rev 17752)
@@ -970,6 +970,7 @@
SHELLEXECUTEINFOW sei_tmp;
PIDLCPanelStruct* pcpanel;
WCHAR path[MAX_PATH];
+ WCHAR params[MAX_PATH];
BOOL ret;
int l;
@@ -990,12 +991,13 @@
/* pass applet name to Control_RunDLL to distinguish between
applets in one .cpl file */
path[l++] = '"';
- path[l++] = ' ';
+ path[l] = '\0';
- MultiByteToWideChar(CP_ACP, 0,
pcpanel->szName+pcpanel->offsDispName, -1, path+l, MAX_PATH);
+ MultiByteToWideChar(CP_ACP, 0,
pcpanel->szName+pcpanel->offsDispName, -1, params, MAX_PATH);
memcpy(&sei_tmp, psei, sizeof(sei_tmp));
sei_tmp.lpFile = path;
+ sei_tmp.lpParameters = params;
sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST;
sei_tmp.lpVerb = wCplopen;
_____
Modified: trunk/reactos/lib/shell32/shlexec.c
--- trunk/reactos/lib/shell32/shlexec.c 2005-09-08 20:53:17 UTC (rev
17751)
+++ trunk/reactos/lib/shell32/shlexec.c 2005-09-08 21:08:53 UTC (rev
17752)
@@ -1263,9 +1263,10 @@
lpFile = wfileName;
+ strcpyW(wcmd, wszApplicationName);
if (sei_tmp.lpParameters[0]) {
- strcatW(wszApplicationName, wSpace);
- strcatW(wszApplicationName, wszParameters);
+ strcatW(wcmd, wSpace);
+ strcatW(wcmd, wszParameters);
}
/* We set the default to open, and that should generally work.
@@ -1273,7 +1274,7 @@
if (!sei_tmp.lpVerb)
sei_tmp.lpVerb = wszOpen;
- retval = execfunc(wszApplicationName, NULL, FALSE, &sei_tmp, sei);
+ retval = execfunc(wcmd, NULL, FALSE, &sei_tmp, sei);
if (retval > 32)
return TRUE;