UE调用外部exe程序及参数传递
/** * */ UCLASS() class TESTELEECTRON_API UWinappBlueprintFunctionLibrary : public UBlueprintFunctionLibrary { GENERATED_BODY() public: UFUNCTION(BlueprintCallable, Category = ExcExe) static bool OpenExe(FString URL, FString Params); };
// Fill out your copyright notice in the Description page of Project Settings. #include "WinappBlueprintFunctionLibrary.h" #include"../Runtime/Core/Public/GenericPlatform/GenericPlatformProcess.h" bool UWinappBlueprintFunctionLibrary::OpenExe(FString URL, FString Params) { FProcHandle currHandle = FPlatformProcess::CreateProc(*URL, *Params, true, false, false, nullptr, 0, nullptr, nullptr); UE_LOG(LogTemp, Warning, TEXT("URL:::%s"), *URL); return true; }