#include #include int main() { STARTUPINFO si = { sizeof(si)}; PROCESS_INFORMATION pi = {0}; // create process if ( CreateProcess("C:\\Windows\\System32\\notepad.exe",NULL,NULL,NULL,FALSE,CREATE_SUSPENDED,NULL,NULL,&si,&pi)) { printf("Process created successfully\n"); printf("Process Id: %lu\n",pi.dwProcessId); printf("Thread Id: %lu\n",pi.dwThreadId); //pause the application getchar(); //resume the thread of notepad.exe ResumeThread(pi.hThread); // close child handle ( notepad.exe ) CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } else { printf("Process not created, ERROR: %lu\n",GetLastError()); return 1; } return 0; }