UE4.26 C++ 打开windows浏览器窗口的方法

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浏览器窗口

猜你喜欢

转载自blog.csdn.net/qq_27033865/article/details/142256198
今日推荐