MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / ShellExecuteFromExplorer

Method ShellExecuteFromExplorer

src/Setup/UpdateRunner.cpp:111–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111HRESULT CUpdateRunner::ShellExecuteFromExplorer(LPWSTR pszFile, LPWSTR pszParameters)
112{
113 HRESULT hr;
114
115 CComPtr<IShellFolderViewDual> spFolderView;
116 hr = GetDesktopAutomationObject(IID_PPV_ARGS(&spFolderView));
117 if (FAILED(hr)) return hr;
118
119 CComPtr<IDispatch> spdispShell;
120 hr = spFolderView->get_Application(&spdispShell);
121 if (FAILED(hr)) return hr;
122
123 return CComQIPtr<IShellDispatch2>(spdispShell)->ShellExecute(
124 CComBSTR(pszFile),
125 CComVariant(pszParameters ? pszParameters : L""),
126 CComVariant(L""),
127 CComVariant(L""),
128 CComVariant(SW_SHOWDEFAULT));
129}
130
131bool CUpdateRunner::DirectoryExists(wchar_t* szPath)
132{

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected