当前位置:网站首页>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

边栏推荐
- 3. Believe you can understand! Circular statements and functions of shell scripts, arrays, bubble sorting
- 4.FTP服务配置与原理
- Supervisor deployment (offline deployment requires downloading the deployment package in advance)
- 9.shell文本处理三剑客之awk
- Idea overall font size modification
- Modify MySQL group error expression 1 of select list is not in group
- Multithreading deadlock and synchronized
- js 哈希表 01
- 6. PXE combines kickstart principle and configuration to realize unattended automatic installation
- SQL topic sorting
猜你喜欢

Angr (III) - angr_ ctf

Add CONDA virtual environment env to the Jupiter kernel

Open虚拟专线网络负载均衡

Pytorch tensor list is converted to tensor list of tensor to tensor using torch.stack()

11.iptables 防火墙

JS encryption parameter positioning

3. Like you, DNS domain name resolution service!!!

2.介绍部署LAMP平台+DISCUZ论坛

3.信你能理解的!shell脚本之循环语句与函数,数组,冒泡排序

Open virtual private line network load balancing
随机推荐
Pytoch separates tensor by the value of one dimension of tensor (simple)
Use of mongodb
MySQL offline deployment
Idea overall font size modification
Multithreading - static proxy mode
9.shell文本处理三剑客之awk
2021 Niuke written examination summary 02
Array static initialization, traversal, maximum value
Pytorch code template (CNN)
6.shell之正则表达式
Using px2rem does not take effect
4. Children next door will know all kinds of shell symbols {}[], etc
Oh my Zsh and TMUX configuration (personal)
Mysql5.7 master-slave database deployment (offline deployment)
存储、计算、分布式计算篇(收集整理适合小白)
微信小程序WxPrase中包含文件无法点击解决
6. PXE combines kickstart principle and configuration to realize unattended automatic installation
TCP transmission
7. Shell practical gadget cut, etc
Acquisition and compilation of UE4 source code