MCPcopy Create free account
hub / github.com/MicrosoftEdge/WebView2Samples / GetLocalPath

Method GetLocalPath

SampleApps/WebView2SampleWinComp/AppWindow.cpp:226–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226std::wstring AppWindow::GetLocalPath(std::wstring relativePath, bool keep_exe_path)
227{
228 WCHAR rawPath[MAX_PATH];
229 GetModuleFileNameW(hInst, rawPath, MAX_PATH);
230 std::wstring path(rawPath);
231 if (keep_exe_path)
232 {
233 path.append(relativePath);
234 }
235 else
236 {
237 std::size_t index = path.find_last_of(L"\\") + 1;
238 path.replace(index, path.length(), relativePath);
239 }
240 return path;
241}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected