MCPcopy Create free account
hub / github.com/ZDoom/Raze / I_OpenShellFolder

Function I_OpenShellFolder

source/common/platform/win32/i_system.cpp:820–842  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

818
819
820void I_OpenShellFolder(const char* infolder)
821{
822 auto len = GetCurrentDirectoryW(0, nullptr);
823 TArray<wchar_t> curdir(len + 1, true);
824 if (!GetCurrentDirectoryW(len + 1, curdir.Data()))
825 {
826 Printf("Unable to retrieve current directory\n");
827 }
828 else if (SetCurrentDirectoryW(WideString(infolder).c_str()))
829 {
830 if (longsavemessages)
831 Printf("Opening folder: %s\n", infolder);
832 ShellExecuteW(NULL, L"open", L"explorer.exe", L".", NULL, SW_SHOWNORMAL);
833 SetCurrentDirectoryW(curdir.Data());
834 }
835 else
836 {
837 if (longsavemessages)
838 Printf("Unable to open directory '%s\n", infolder);
839 else
840 Printf("Unable to open requested directory\n");
841 }
842}
843

Callers

nothing calls this directly

Calls 4

PrintfFunction · 0.85
WideStringFunction · 0.85
c_strMethod · 0.80
DataMethod · 0.45

Tested by

no test coverage detected