Created
October 9, 2016 16:37
-
-
Save AlexBolotsin/8377d9a00f85c1cf6fdda184bb19d835 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <iostream> | |
int main() | |
{ | |
STARTUPINFO si; | |
PROCESS_INFORMATION pi; | |
ZeroMemory(&si, sizeof(si)); | |
si.cb = sizeof(si); | |
ZeroMemory(&pi, sizeof(pi)); | |
// "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" | |
if (!CreateProcess(L"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe", | |
L"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe", | |
NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) | |
std::cout << "Error! " << GetLastError() << "\n"; | |
WaitForSingleObject(pi.hProcess, INFINITE); | |
CloseHandle(pi.hProcess); | |
CloseHandle(pi.hThread); | |
return EXIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment