#include <windows/WindowsWindow.h> #include "Windows/AllowWindowsPlatformTypes.h" #include <windows.h> #include <shellapi.h> #include "Windows/HideWindowsPlatformTypes.h" UUETuioBPLibrary::UUETuioBPLibrary(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { } float UUETuioBPLibrary::UETuioSampleFunction(float Param) { return -1; } void UUETuioBPLibrary::MyWindowShow() { #if PLATFORM_WINDOWS TSharedPtr<FGenericWindow> NativeWindow = GEngine->GameViewport->GetWindow()->GetNativeWindow(); FWindowsWindow* Window = static_cast<FWindowsWindow*>(NativeWindow.Get()); HWND hWnd = Window->GetHWnd(); #endif // #if PLATFORM_WINDOWS ::ShowWindow(hWnd, SW_SHOWNORMAL); } void UUETuioBPLibrary::MyWindowHide() { #if PLATFORM_WINDOWS TSharedPtr<FGenericWindow> NativeWindow = GEngine->GameViewport->GetWindow()->GetNativeWindow(); FWindowsWindow* Window = static_cast<FWindowsWindow*>(NativeWindow.Get()); HWND hWnd = Window->GetHWnd(); #endif // #if PLATFORM_WINDOWS ::ShowWindow(hWnd, SW_MINIMIZE); }
标签:记录,WINDOWS,hWnd,C++,PLATFORM,Window,UE,include,UUETuioBPLibrary From: https://www.cnblogs.com/dragon2012/p/17982464