| 238 | } |
| 239 | |
| 240 | bool osShellExecute(const char* pathToExe, const char* exeDir, const char* param, bool waitForCompletion) |
| 241 | { |
| 242 | #ifdef _WIN32 |
| 243 | // Prepare shellExecutInfo |
| 244 | SHELLEXECUTEINFO ShExecInfo = { 0 }; |
| 245 | ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); |
| 246 | ShExecInfo.fMask = waitForCompletion ? SEE_MASK_NOCLOSEPROCESS : 0; |
| 247 | ShExecInfo.hwnd = NULL; |
| 248 | ShExecInfo.lpVerb = NULL; |
| 249 | ShExecInfo.lpFile = pathToExe; |
| 250 | ShExecInfo.lpParameters = param; |
| 251 | ShExecInfo.lpDirectory = exeDir; |
| 252 | ShExecInfo.nShow = SW_SHOW; |
| 253 | ShExecInfo.hInstApp = NULL; |
| 254 | |
| 255 | // Execute the file with the parameters |
| 256 | if (!ShellExecuteEx(&ShExecInfo)) |
| 257 | { |
| 258 | return false; |
| 259 | } |
| 260 | |
| 261 | if (waitForCompletion) |
| 262 | { |
| 263 | WaitForSingleObject(ShExecInfo.hProcess, INFINITE); |
| 264 | CloseHandle(ShExecInfo.hProcess); |
| 265 | } |
| 266 | return true; |
| 267 | #endif |
| 268 | return false; |
| 269 | } |
| 270 | |
| 271 | void postErrorMessageBox(const char* msg, const char* title) |
| 272 | { |
no outgoing calls
no test coverage detected