on s'enerve pas...
pour lancer un processus (toto.exe avec l'argument arg1)
#include <windows.h>
int init_proc(char* proc_location,char* command_line);
int WINAPI
WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR pszCmdLine, int iCmdShow)
{
init_proc("C:\\Program Files\\softruc\\toto.exe",
"C:\\Program Files\\softruc\\toto.exe"
" /arg1" );
}
int init_proc(char* proc_location,char* command_line)
{
BOOL bWorked;
STARTUPINFO suInfo;
PROCESS_INFORMATION procInfo;
char* m_Process = proc_location;
char *vip = command_line;
memset (&suInfo, 0, sizeof(suInfo));
suInfo.cb = sizeof(suInfo);
bWorked = ::CreateProcess(m_Process,
vip,
NULL,
NULL,
FALSE,
NORMAL_PRIORITY_CLASS,
NULL,
NULL,
&suInfo,
&procInfo);
return bWorked;
}