MCPcopy Create free account
hub / github.com/bumptop/BumpTop / launchFile

Method launchFile

trunk/win/Source/BT_FileSystemManager.cpp:1058–1095  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1056}
1057
1058bool FileSystemManager::launchFile(SHELLEXECUTEINFO sei, QString filePath) {
1059
1060 QString errMsg;
1061
1062 if(!ShellExecuteEx(&sei))
1063 {
1064 // for all intents and purposes, we will return true after an
1065 // async execution
1066
1067 int rcVal = (int) sei.hInstApp;
1068
1069 errMsg = QT_TR_NOOP("BumpTop failed to launch file: %1.\n\n").arg(filePath);
1070
1071 // Select the appropriate Message
1072 switch (rcVal)
1073 {
1074 case 0: errMsg.append("Out of Memory or Resources."); break;
1075 case ERROR_BAD_FORMAT: errMsg.append("The .exe file is invalid (non-Microsoft Win32 .exe or error in .exe image). "); break;
1076 case SE_ERR_ACCESSDENIED: errMsg.append("The operating system denied access to the specified file or link target. "); break;
1077 case SE_ERR_ASSOCINCOMPLETE: errMsg.append("The file name association is incomplete or invalid. "); break;
1078 case SE_ERR_DDEBUSY: errMsg.append("The Dynamic Data Exchange (DDE) transaction could not be completed because other DDE transactions were being processed. "); break;
1079 case SE_ERR_DDEFAIL: errMsg.append("The DDE transaction failed. "); break;
1080 case SE_ERR_DDETIMEOUT: errMsg.append("The DDE transaction could not be completed because the request timed out. "); break;
1081 case SE_ERR_DLLNOTFOUND: errMsg.append("The specified DLL was not found. "); break;
1082 case SE_ERR_FNF: errMsg.append("The specified file was not found. "); break;
1083 case SE_ERR_NOASSOC: errMsg.append("There is no application associated with the given file name extension. "); break;
1084 case SE_ERR_OOM: errMsg.append("There was not enough memory to complete the operation. "); break;
1085 case SE_ERR_PNF: errMsg.append("The specified path was not found. "); break;
1086 case SE_ERR_SHARE: errMsg.append("A sharing violation occurred. "); break;
1087 }
1088
1089 printUnique("FileSystemManager::launchFile", errMsg);
1090 return false;
1091
1092 }
1093
1094 return true;
1095}
1096
1097bool FileSystemManager::launchFile(QString filePath, LPWSTR verb)
1098{

Callers 14

onLaunchMethod · 0.80
launchWidgetOverrideMethod · 0.80
launchMethod · 0.80
downloadFinishedMethod · 0.80
onStateChangedMethod · 0.80
RelaunchBumpTopMethod · 0.80
FailOnDriversMethod · 0.80
invokeCommandMethod · 0.80
finishedMethod · 0.80
MsgProcMethod · 0.80
launchUrlMethod · 0.80

Calls 7

ensureQuotedFunction · 0.85
GetPidlFromNameMethod · 0.80
GetWindowsHandleMethod · 0.80
argMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected