Skip to content

Instantly share code, notes, and snippets.

@andymasteroffish
Created May 29, 2018 20:18
Show Gist options
  • Save andymasteroffish/8dd5c1370b6f8de490cc49679717e191 to your computer and use it in GitHub Desktop.
Save andymasteroffish/8dd5c1370b6f8de490cc49679717e191 to your computer and use it in GitHub Desktop.
openFrameworks function to launch an exe used for Dream BoxXx
void ofApp::launchExe(string path) {
if (isFullScreened()) {
ofToggleFullscreen();
}
std::wstring pathTemp = std::wstring(path.begin(), path.end());
LPCWSTR pathLPC = pathTemp.c_str();
string command = "open";
std::wstring commandTemp = std::wstring(command.begin(), command.end());
LPCWSTR commandLPC = commandTemp.c_str();
ShellExecute(NULL, commandLPC, pathLPC, NULL, NULL, SW_SHOWDEFAULT);
canSelectGame = false;
if (closeAfterLaunchingGame) {
ofExit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment