Last active
July 17, 2020 06:33
-
-
Save ntropy83/b7e653c1eeefc9e68d1ba2cfe7b2d7f5 to your computer and use it in GitHub Desktop.
win_homeoffice_quicklauncher
This file contains hidden or 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> | |
VOID startup(LPCTSTR lpApplicationName) | |
{ | |
// additional information | |
STARTUPINFO si; | |
PROCESS_INFORMATION pi; | |
// set the size of the structures | |
ZeroMemory( &si, sizeof(si) ); | |
si.cb = sizeof(si); | |
ZeroMemory( &pi, sizeof(pi) ); | |
// start the program up | |
CreateProcess( lpApplicationName, // the path | |
_argv[1], // Command line | |
NULL, // Process handle not inheritable | |
NULL, // Thread handle not inheritable | |
FALSE, // Set handle inheritance to FALSE | |
0, // No creation flags | |
NULL, // Use parent's environment block | |
NULL, // Use parent's starting directory | |
&si, // Pointer to STARTUPINFO structure | |
&pi // Pointer to PROCESS_INFORMATION structure (removed extra parentheses) | |
); | |
// Close process and thread handles. | |
CloseHandle( pi.hProcess ); | |
CloseHandle( pi.hThread ); | |
} | |
int main(int argc, char** _argv) { | |
startup("PATH_TO_firefox.exe"); | |
startup("PATH_TO_thunderbird.exe"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated title