FilePath:需要打开的文件路径(例如:D:\XXX.txt)
const char* str = TCHAR_TO_ANSI(*FilePath);
#if PLATFORM_WINDOWS
ShellExecuteA(nullptr, "open", str, NULL, NULL, SW_SHOW);
return true;
#else
UE_LOG(Log_Temp, Log, TEXT("platform is not support!"));
return false;
#endif
记得加头文件:
#if PLATFORM_WINDOWS
#include "Windows/MinWindows.h"
#include <shellapi.h>
#endif