starting mlcfg32.cpl thru CreateProcess()

  • Thread starter Thread starter Girish NS
  • Start date Start date
G

Girish NS

Hi,

I 'm trying to start mlcfg32.cpl thru CreateProcess(). The .cpl file is in
C:\Program Files\Common Files\System\Mapi\1033 folder instead of
C:\WINNT\system32 where the default control panel applets are located. Here
is the code I'm using. This code works when I'm trying to run control panel
applets which are located in C:\WINNT\system32 directory but fails for
control panel applets which are not in that directory. Am I missing
something?

STARTUPINFO si;
PROCESS_INFORMATION pi;
BOOL blnresult = FALSE;
ZeroMemory(&si,sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi,sizeof(pi));
blnresult = CreateProcess(NULL,
"Rundll32.exe shell32.dll,Control_RunDLL mlcfg32.cpl",
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi);
if(!blnresult)
MessageBox(0,"unable to create process",0,0);
WaitForSingleObject(pi.hProcess,INFINITE);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);

Thanks for any help.

Girish.
 
Back
Top