Hash :
e1fe242d
Author :
Date :
2019-02-22T06:11:22
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#define _XOPEN_SOURCE 500
#include <stdlib.h>
#ifdef __MINGW32__
#include <sys/types.h>
#endif /* __MINGW32__ */
#include <sys/wait.h>
#include <windows.h>
#include <tchar.h>
void run_process(TCHAR * name)
{
STARTUPINFO si;
memset(&si, 0, sizeof(si));
si.cb = sizeof(STARTUPINFO);
PROCESS_INFORMATION pi;
memset(&pi, 0, sizeof(pi));
if (CreateProcess(NULL, name, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
{
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
}
int main(int argc, char * argv[])
{
run_process(_T("notepad.exe"));
run_process(_T("mspaint.exe"));
while (wait(0) > 0) {}
return EXIT_SUCCESS;
}