#include "stdafx.h"
DWORD Interval_of_delay(LPSTR lpCmdLine) { STARTUPINFO start_info;
ZeroMemory(&start_info ,sizeof(start_info)); start_info.cb = sizeof(start_info);
PROCESS_INFORMATION proc_info;
ZeroMemory(&proc_info ,sizeof(proc_info));
if(!CreateProcess(NULL, lpCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &start_info, &proc_info)) { return GetLastError(); }
WaitForSingleObject(proc_info.hProcess, INFINITE); CloseHandle(proc_info.hProcess);
return 0; }
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // TODO: Place code here. Interval_of_delay("Notepad"); MessageBeep(MB_OK); return 0; } |