1.新建蓝图函数库类
2.在.h中创建函数
UFUNCTION(BlueprintCallable, Category = "OpenExplore")
static void ExploreFloder(FString path);
3.在.cpp中实现函数
void UMyBlueprintFunctionLibrary::ExploreFloder(FString path)
{
std::string str_path = TCHAR_TO_UTF8(*path);
std::wstring wstr_path;
wstr_path.assign(str_path.begin(), str_path.end());
ShellExecute(NULL, TEXT("explore"), wstr_path.c_str(), NULL, NULL, SW_SHOWDEFAULT);
}
4.在蓝图中需要位置调用函数打开指定路径下的Windows浏览器窗口