MCPcopy Create free account
hub / github.com/ariccio/altWinDirStat / RunApplication

Function RunApplication

Reference code/osImageTool/XDAOSImageWriter.cpp:18–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16#include "Configuration.h"
17
18bool RunApplication(const char *szAppname, const char *szCommandLine)
19{
20 SHELLEXECUTEINFO exec;
21 memset(&exec, 0, sizeof(SHELLEXECUTEINFO));
22 exec.cbSize= sizeof(SHELLEXECUTEINFO);
23 exec.lpFile= szAppname;
24 exec.lpParameters= szCommandLine;
25 exec.lpVerb= "open";
26 exec.lpDirectory= g_cfg.ApplicationRoot.c_str();
27 exec.nShow= SW_SHOW;
28 exec.fMask= SEE_MASK_FLAG_NO_UI|SEE_MASK_NOCLOSEPROCESS;
29
30 if (!ShellExecuteEx(&exec))
31 {
32 g_err.Set(stringformat("error executing %s: %s", szAppname, LastError().c_str()));
33 return false;
34 }
35 return true;
36}
37string concatpath(const string& path1, const string& path2)
38{
39 string path= path1;

Callers 1

CloseMethod · 0.85

Calls 3

stringformatFunction · 0.85
LastErrorFunction · 0.85
SetMethod · 0.45

Tested by

no test coverage detected