#include #include int main() { // initialize startupinfo , processinfo structure to zero STARTUPINFO si = { sizeof(si) }; // sets up si to zero. PROCESS_INFORMATION pi = {0}; // sets up pi to zero. // use createprocess function to launch notepad if(CreateProcess("C:\\Windows\\System32\\notepad.exe", NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ) ) { printf("Process created successfully\n Process ID: %lu\nThread ID: %lu\n",pi.dwProcessId,pi.dwThreadId); // close the handles CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } else { printf("Process not created , ERROR: %lu\n",GetLastError()); return 1; } return 0; }