Skip to content

Instantly share code, notes, and snippets.

@scytacki
Created May 20, 2015 14:17
Show Gist options
  • Save scytacki/7b571c257897269efaff to your computer and use it in GitHub Desktop.
Save scytacki/7b571c257897269efaff to your computer and use it in GitHub Desktop.
void QlmLicenseWizardDlg::LaunchApplicationAndWait(CString strCmdLine, CString strArgs, CString strRunningDir){
SHELLEXECUTEINFO ShExecInfo;
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = strCmdLine.GetBuffer();
ShExecInfo.lpParameters = strArgs.GetBuffer();
ShExecInfo.lpDirectory = strRunningDir.GetBuffer();
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment