тьма всякого барахла
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#include "createProcess.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FcreateProcessModule"
|
||||
|
||||
void FcreateProcessModule::StartupModule()
|
||||
{
|
||||
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
|
||||
|
||||
}
|
||||
|
||||
void FcreateProcessModule::ShutdownModule()
|
||||
{
|
||||
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
|
||||
// we call this function before unloading the module.
|
||||
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
|
||||
IMPLEMENT_MODULE(FcreateProcessModule, createProcess)
|
||||
@@ -0,0 +1,46 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#include "createProcessBPLibrary.h"
|
||||
#include "createProcess.h"
|
||||
|
||||
UcreateProcessBPLibrary::UcreateProcessBPLibrary(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void UcreateProcessBPLibrary::createProc(FString FullPathOfProgramToRun, TArray<FString> CommandlineArgs, bool Detach, bool Hidden, int32 Priority, FString OptionalWorkingDirectory)
|
||||
{ //Please note ProcessId should really be uint32 but that is not supported by BP yet
|
||||
|
||||
FString Args = "";
|
||||
if (CommandlineArgs.Num() > 1)
|
||||
{
|
||||
Args = CommandlineArgs[0];
|
||||
for (int32 v = 1; v < CommandlineArgs.Num(); v++)
|
||||
{
|
||||
Args += " " + CommandlineArgs[v];
|
||||
}
|
||||
}
|
||||
else if (CommandlineArgs.Num() > 0)
|
||||
{
|
||||
Args = CommandlineArgs[0];
|
||||
}
|
||||
|
||||
//uint32 NeedBPUINT32 = 0;
|
||||
FPlatformProcess::CreateProc(
|
||||
*FullPathOfProgramToRun,
|
||||
*Args,
|
||||
Detach,//* @param bLaunchDetached if true, the new process will have its own window
|
||||
false,//* @param bLaunchHidded if true, the new process will be minimized in the task bar
|
||||
Hidden,//* @param bLaunchReallyHidden if true, the new process will not have a window or be in the task bar
|
||||
0,
|
||||
Priority,
|
||||
(OptionalWorkingDirectory != "") ? *OptionalWorkingDirectory : nullptr,//const TCHAR* OptionalWorkingDirectory,
|
||||
nullptr
|
||||
);
|
||||
}
|
||||
|
||||
void UcreateProcessBPLibrary::RunSystemCommand(FString Command)
|
||||
{
|
||||
system(TCHAR_TO_ANSI(*Command));
|
||||
}
|
||||
Reference in New Issue
Block a user