当前位置:网站首页>UE4 external open EXE file
UE4 external open EXE file
2022-07-25 10:37:00 【Flying Pig】
Recently, I saw a problem when I studied the unreal source code , I want to try opening the packaged exe file , I found these two functions
Header files need to be added in the early stage
#include"Runtime/Core/Public/HAL/PlatformFilemanager.h"
#include"Runtime/Core/Public/Misc/FileHelper.h"
#include"Runtime/Core/Public/Misc/Paths.h"
#include "Windows/AllowWindowsPlatformTypes.h"
#include "Windows/PreWindowsApi.h"
#include <windows.h>
#include <string>
#include "Windows/PostWindowsApi.h"
#include "Windows/HideWindowsPlatformTypes.h"
#include <ShlDisp.h>
#include <shellapi.h>
One 、UFUNCTION(BlueprintCallable)
void OpenExternalApp(const FString& AppPath);
.h file
UFUNCTION(BlueprintCallable)
void OpenExternalApp(const FString& AppPath);
.cpp file
void AMyGameMode::OpenExternalApp(const FString& AppPath)
{
pHandle = FPlatformProcess::CreateProc(*AppPath, nullptr, true, false, false, nullptr, 0, nullptr, nullptr);
UE_LOG(LogTemp, Warning, TEXT(__FUNCTION__"Create App"))
} Two 、UFUNCTION(BlueprintCallable)
void ExecuteExternalApp(const FString& AppPath);
.h file
UFUNCTION(BlueprintCallable)
void ExecuteExternalApp(const FString& AppPath);
.cpp file
void AMyGameMode::ExecuteExternalApp(const FString& AppPath)
{
std::string str_path = TCHAR_TO_UTF8(*AppPath);
std::wstring wstr_path;
wstr_path.assign(str_path.begin(), str_path.end());
ShellExecute(NULL, L"open", wstr_path.c_str(), NULL, NULL, SW_SHOWDEFAULT);
}3、 ... and 、 Blueprint operation
Open the stage blueprint , I put it here GamemMode Written inside

边栏推荐
- About the jar package of slf4j log4j log4j2 used together
- Principle of struct2
- Array static initialization, traversal, maximum value
- FRP reverse proxy deployment
- 4、 Testfixture test fixture, or test firmware
- 云原生IDE:iVX免费的首个通用无代码开发平台
- JS encryption parameter positioning
- js 哈希表 02
- Angr (VIII) -- angr_ ctf
- 四、TestFixture测试夹具,或者测试固件
猜你喜欢

js 哈希表 02

After switching the shell command line terminal (bash/zsh), CONDA cannot be used: command not found

js 双向链表 02

disabled和readonly 以及焦点问题

5. This simple "echo" usage, can the child next door!

Number theory -- negative Radix conversion

Vscode latex workshop set xelatex compilation

Angr(三)——angr_ctf

Angr (IX) -- angr_ ctf

1.Shell编程规范与变量
随机推荐
Detailed explanation of chrome developer tools
ONNX Runtime介绍
2021 jd.com written examination summary
DHCP configuration (take Huawei ENSP as an example)
Mysql5.7主从数据库部署(离线部署)
2.介绍部署LAMP平台+DISCUZ论坛
Notes on building dompteur container
Modify MySQL group error expression 1 of select list is not in group
Pytorch calculates the loss for each sample in the batch
Angr(二)——angr_ctf
2. Conditional statements of shell script
js 哈希表 02
2、 What does the unittest framework do
9.shell文本处理三剑客之awk
SQL topic sorting
Supervisor deployment (offline deployment requires downloading the deployment package in advance)
Angr (IX) -- angr_ ctf
Number theory --- the greatest common divisor and the least common multiple
Angr (III) - angr_ ctf
TCP transmission