UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FWindowsWindow Class Reference

#include <WindowsWindow.h>

+ Inheritance diagram for FWindowsWindow:

Public Member Functions

APPLICATIONCORE_API ~FWindowsWindow ()
 
APPLICATIONCORE_API HWND GetHWnd () const
 
APPLICATIONCORE_API void Initialize (class FWindowsApplication *const Application, const TSharedRef< FGenericWindowDefinition > &InDefinition, HINSTANCE InHInstance, const TSharedPtr< FWindowsWindow > &InParent, const bool bShowImmediately)
 
APPLICATIONCORE_API bool IsRegularWindow () const
 
APPLICATIONCORE_API void AdjustWindowRegion (int32 Width, int32 Height)
 
virtual APPLICATIONCORE_API void AdjustCachedSize (FVector2D &Size) const override
 
virtual float GetDPIScaleFactor () const override
 
virtual void SetDPIScaleFactor (float Value) override
 
virtual APPLICATIONCORE_API bool IsManualManageDPIChanges () const override
 
virtual APPLICATIONCORE_API void SetManualManageDPIChanges (const bool bManualDPIChanges) override
 
APPLICATIONCORE_API void OnParentWindowMinimized ()
 
APPLICATIONCORE_API void OnParentWindowRestored ()
 
APPLICATIONCORE_API void OnTransparencySupportChanged (EWindowTransparency NewTransparency)
 
float GetAspectRatio () const
 
APPLICATIONCORE_API bool IsEnabled ()
 
APPLICATIONCORE_API TArray< FColorGetWindowPixels (uint32 &OutWidth, uint32 &OutHeight)
 
virtual APPLICATIONCORE_API void ReshapeWindow (int32 X, int32 Y, int32 Width, int32 Height) override
 
virtual APPLICATIONCORE_API bool GetFullScreenInfo (int32 &X, int32 &Y, int32 &Width, int32 &Height) const override
 
virtual APPLICATIONCORE_API void MoveWindowTo (int32 X, int32 Y) override
 
virtual APPLICATIONCORE_API void BringToFront (bool bForce=false) override
 
virtual APPLICATIONCORE_API void HACK_ForceToFront () override
 
virtual APPLICATIONCORE_API void Destroy () override
 
virtual APPLICATIONCORE_API void Minimize () override
 
virtual APPLICATIONCORE_API void Maximize () override
 
virtual APPLICATIONCORE_API void Restore () override
 
virtual APPLICATIONCORE_API void Show () override
 
virtual APPLICATIONCORE_API void Hide () override
 
virtual APPLICATIONCORE_API void SetWindowMode (EWindowMode::Type NewWindowMode) override
 
virtual EWindowMode::Type GetWindowMode () const override
 
virtual APPLICATIONCORE_API bool IsMaximized () const override
 
virtual APPLICATIONCORE_API bool IsMinimized () const override
 
virtual APPLICATIONCORE_API bool IsVisible () const override
 
virtual APPLICATIONCORE_API bool GetRestoredDimensions (int32 &X, int32 &Y, int32 &Width, int32 &Height) override
 
virtual APPLICATIONCORE_API void SetWindowFocus () override
 
virtual APPLICATIONCORE_API void SetOpacity (const float InOpacity) override
 
virtual APPLICATIONCORE_API void Enable (bool bEnable) override
 
virtual APPLICATIONCORE_API bool IsPointInWindow (int32 X, int32 Y) const override
 
virtual APPLICATIONCORE_API int32 GetWindowBorderSize () const override
 
virtual APPLICATIONCORE_API int32 GetWindowTitleBarSize () const override
 
virtual voidGetOSWindowHandle () const override
 
virtual APPLICATIONCORE_API bool IsForegroundWindow () const override
 
virtual APPLICATIONCORE_API bool IsFullscreenSupported () const override
 
virtual APPLICATIONCORE_API void SetText (const TCHAR *const Text) override
 
virtual APPLICATIONCORE_API void DrawAttention (const FWindowDrawAttentionParameters &Parameters) override
 
APPLICATIONCORE_API HRESULT STDCALL QueryInterface (REFIID iid, void **ppvObject) override
 
APPLICATIONCORE_API ULONG STDCALL AddRef (void) override
 
APPLICATIONCORE_API ULONG STDCALL Release (void) override
 
virtual APPLICATIONCORE_API HRESULT STDCALL DragEnter (__RPC__in_opt IDataObject *DataObjectPointer, ::DWORD KeyState, POINTL CursorPosition, __RPC__inout ::DWORD *CursorEffect) override
 
virtual APPLICATIONCORE_API HRESULT STDCALL DragOver (::DWORD KeyState, POINTL CursorPosition, __RPC__inout ::DWORD *CursorEffect) override
 
virtual APPLICATIONCORE_API HRESULT STDCALL DragLeave (void) override
 
virtual APPLICATIONCORE_API HRESULT STDCALL Drop (__RPC__in_opt IDataObject *DataObjectPointer, ::DWORD KeyState, POINTL CursorPosition, __RPC__inout ::DWORD *CursorEffect) override
 
- Public Member Functions inherited from FGenericWindow
APPLICATIONCORE_API FGenericWindow ()
 
virtual APPLICATIONCORE_API ~FGenericWindow ()
 
virtual APPLICATIONCORE_API const FGenericWindowDefinitionGetDefinition () const
 
virtual APPLICATIONCORE_API bool IsDefinitionValid () const
 
virtual APPLICATIONCORE_API void SetNativeWindowButtonsVisibility (bool bVisible)
 

Static Public Member Functions

static APPLICATIONCORE_API TSharedRef< FWindowsWindowMake ()
 

Static Public Attributes

static APPLICATIONCORE_API const TCHAR AppWindowClass [] = TEXT("UnrealWindow")
 

Additional Inherited Members

- Protected Attributes inherited from FGenericWindow
TSharedPtr< FGenericWindowDefinitionDefinition
 

Detailed Description

A platform specific implementation of FNativeWindow.

Native Windows provide platform-specific backing for and are always owned by an SWindow.

Constructor & Destructor Documentation

◆ ~FWindowsWindow()

FWindowsWindow::~FWindowsWindow ( )

Destructor.

Member Function Documentation

◆ AddRef()

ULONG STDCALL FWindowsWindow::AddRef ( void  )
override

◆ AdjustCachedSize()

void FWindowsWindow::AdjustCachedSize ( FVector2D Size) const
overridevirtual
Returns
Gives the native window a chance to adjust our stored window size before we cache it off.

Reimplemented from FGenericWindow.

◆ AdjustWindowRegion()

void FWindowsWindow::AdjustWindowRegion ( int32  Width,
int32  Height 
)

Sets the window region to specified dimensions.

Parameters
WidthThe width of the window region (in pixels).
HeightThe height of the window region (in pixels).

◆ BringToFront()

void FWindowsWindow::BringToFront ( bool  bForce = false)
overridevirtual

Native windows should implement BringToFront by making this window the top-most window (i.e. focused).

Parameters
bForceForces the window to the top of the Z order, even if that means stealing focus from other windows In general do not pass true for this. It is really only useful for some windows, like game windows where not forcing it to the front could cause mouse capture and mouse lock to happen but without the window visible

Reimplemented from FGenericWindow.

◆ Destroy()

void FWindowsWindow::Destroy ( )
overridevirtual

Native windows should implement this function by asking the OS to destroy OS-specific resource associated with the window (e.g. Win32 window handle)

Reimplemented from FGenericWindow.

◆ DragEnter()

HRESULT STDCALL FWindowsWindow::DragEnter ( __RPC__in_opt IDataObject DataObjectPointer,
::DWORD  KeyState,
POINTL  CursorPosition,
__RPC__inout ::DWORD *  CursorEffect 
)
overridevirtual

◆ DragLeave()

HRESULT STDCALL FWindowsWindow::DragLeave ( void  )
overridevirtual

◆ DragOver()

HRESULT STDCALL FWindowsWindow::DragOver ( ::DWORD  KeyState,
POINTL  CursorPosition,
__RPC__inout ::DWORD *  CursorEffect 
)
overridevirtual

◆ DrawAttention()

void FWindowsWindow::DrawAttention ( const FWindowDrawAttentionParameters Parameters)
overridevirtual

Attempts to draw the user's attention to this window in whatever way is appropriate for the platform if this window is not the current active window.

Parameters
ParametersThe parameters for drawing attention. Depending on the platform, not all parameters may be supported.

Reimplemented from FGenericWindow.

◆ Drop()

HRESULT STDCALL FWindowsWindow::Drop ( __RPC__in_opt IDataObject DataObjectPointer,
::DWORD  KeyState,
POINTL  CursorPosition,
__RPC__inout ::DWORD *  CursorEffect 
)
overridevirtual

◆ Enable()

void FWindowsWindow::Enable ( bool  bEnable)
overridevirtual

Enables or disables this window. When disabled, a window will receive no input.

Parameters
bEnabletrue to enable the window, false to disable it.

Reimplemented from FGenericWindow.

◆ GetAspectRatio()

float FWindowsWindow::GetAspectRatio ( ) const
inline

◆ GetDPIScaleFactor()

virtual float FWindowsWindow::GetDPIScaleFactor ( ) const
inlineoverridevirtual
Returns
ratio of pixels to SlateUnits in this window. E.g. DPIScale of 2.0 means there is a 2x2 pixel square for every 1x1 SlateUnit.

Reimplemented from FGenericWindow.

◆ GetFullScreenInfo()

bool FWindowsWindow::GetFullScreenInfo ( int32 X,
int32 Y,
int32 Width,
int32 Height 
) const
overridevirtual

Returns the rectangle of the screen the window is associated with

Reimplemented from FGenericWindow.

◆ GetHWnd()

HWND FWindowsWindow::GetHWnd ( ) const

Gets the Window's handle.

Returns
The window's HWND handle.

◆ GetOSWindowHandle()

virtual void * FWindowsWindow::GetOSWindowHandle ( ) const
inlineoverridevirtual

Gets the OS Window handle in the form of a void pointer for other API's

Reimplemented from FGenericWindow.

◆ GetRestoredDimensions()

bool FWindowsWindow::GetRestoredDimensions ( int32 X,
int32 Y,
int32 Width,
int32 Height 
)
overridevirtual

Returns the size and location of the window when it is restored

Reimplemented from FGenericWindow.

◆ GetWindowBorderSize()

int32 FWindowsWindow::GetWindowBorderSize ( ) const
overridevirtual

Gets OS specific window border size. This is necessary because Win32 does not give control over this size.

Reimplemented from FGenericWindow.

◆ GetWindowMode()

virtual EWindowMode::Type FWindowsWindow::GetWindowMode ( ) const
inlineoverridevirtual
Returns
true if the native window is currently in fullscreen mode, false otherwise

Reimplemented from FGenericWindow.

◆ GetWindowPixels()

TArray< FColor > FWindowsWindow::GetWindowPixels ( uint32 OutWidth,
uint32 OutHeight 
)

◆ GetWindowTitleBarSize()

int32 FWindowsWindow::GetWindowTitleBarSize ( ) const
overridevirtual

Gets OS specific window title bar size

Reimplemented from FGenericWindow.

◆ HACK_ForceToFront()

void FWindowsWindow::HACK_ForceToFront ( )
overridevirtual

@hack Force a window to front even if a different application is in front.

Reimplemented from FGenericWindow.

◆ Hide()

void FWindowsWindow::Hide ( )
overridevirtual

Native window should hide itself

Reimplemented from FGenericWindow.

◆ Initialize()

void FWindowsWindow::Initialize ( class FWindowsApplication *const  Application,
const TSharedRef< FGenericWindowDefinition > &  InDefinition,
HINSTANCE  InHInstance,
const TSharedPtr< FWindowsWindow > &  InParent,
const bool  bShowImmediately 
)

◆ IsEnabled()

bool FWindowsWindow::IsEnabled ( )
Returns
True if the window is enabled

◆ IsForegroundWindow()

bool FWindowsWindow::IsForegroundWindow ( ) const
overridevirtual
Returns
true if the window is in the foreground

Reimplemented from FGenericWindow.

◆ IsFullscreenSupported()

bool FWindowsWindow::IsFullscreenSupported ( ) const
overridevirtual
Returns
true if the window is in the foreground

Reimplemented from FGenericWindow.

◆ IsManualManageDPIChanges()

bool FWindowsWindow::IsManualManageDPIChanges ( ) const
overridevirtual

determines whether or not this window does its own DPI management

Reimplemented from FGenericWindow.

◆ IsMaximized()

bool FWindowsWindow::IsMaximized ( ) const
overridevirtual
Returns
true if the native window is maximized, false otherwise

Reimplemented from FGenericWindow.

◆ IsMinimized()

bool FWindowsWindow::IsMinimized ( ) const
overridevirtual
Returns
true if the native window is minimized, false otherwise

Reimplemented from FGenericWindow.

◆ IsPointInWindow()

bool FWindowsWindow::IsPointInWindow ( int32  X,
int32  Y 
) const
overridevirtual
Returns
true if native window exists underneath the coordinates

Reimplemented from FGenericWindow.

◆ IsRegularWindow()

bool FWindowsWindow::IsRegularWindow ( ) const

Sets the window text (usually the title but can also be text content for things like controls).

Parameters
TextThe window's title or content text

◆ IsVisible()

bool FWindowsWindow::IsVisible ( ) const
overridevirtual
Returns
true if the native window is visible, false otherwise

Reimplemented from FGenericWindow.

◆ Make()

TSharedRef< FWindowsWindow > FWindowsWindow::Make ( )
static

Create a new FWin32Window.

◆ Maximize()

void FWindowsWindow::Maximize ( )
overridevirtual

Native window should implement this function by performing the equivalent of the Win32 maximize operation

Reimplemented from FGenericWindow.

◆ Minimize()

void FWindowsWindow::Minimize ( )
overridevirtual

Native window should implement this function by performing the equivalent of the Win32 minimize-to-taskbar operation

Reimplemented from FGenericWindow.

◆ MoveWindowTo()

void FWindowsWindow::MoveWindowTo ( int32  X,
int32  Y 
)
overridevirtual

Native windows should implement MoveWindowTo by relocating the client area of the platform-specific window to (X,Y).

Reimplemented from FGenericWindow.

◆ OnParentWindowMinimized()

void FWindowsWindow::OnParentWindowMinimized ( )

Called when our parent window is minimized (which will in turn cause us to become minimized).

◆ OnParentWindowRestored()

void FWindowsWindow::OnParentWindowRestored ( )

Called when our parent window is restored (which will in turn cause us to become restored).

◆ OnTransparencySupportChanged()

void FWindowsWindow::OnTransparencySupportChanged ( EWindowTransparency  NewTransparency)

Called by the owning application when the level of transparency support has changed

◆ QueryInterface()

HRESULT STDCALL FWindowsWindow::QueryInterface ( REFIID  iid,
void **  ppvObject 
)
override

◆ Release()

ULONG STDCALL FWindowsWindow::Release ( void  )
override

◆ ReshapeWindow()

void FWindowsWindow::ReshapeWindow ( int32  X,
int32  Y,
int32  Width,
int32  Height 
)
overridevirtual

Native windows should implement ReshapeWindow by changing the platform-specific window to be located at (X,Y) and be the dimensions Width x Height.

Reimplemented from FGenericWindow.

◆ Restore()

void FWindowsWindow::Restore ( )
overridevirtual

Native window should implement this function by performing the equivalent of the Win32 maximize operation

Reimplemented from FGenericWindow.

◆ SetDPIScaleFactor()

virtual void FWindowsWindow::SetDPIScaleFactor ( float  Factor)
inlineoverridevirtual

sets a new DPI scale factor

Reimplemented from FGenericWindow.

◆ SetManualManageDPIChanges()

void FWindowsWindow::SetManualManageDPIChanges ( const bool  bManualDPIChanges)
overridevirtual

call with a true argument if this window need to do its custom size management in response to DPI variations

Reimplemented from FGenericWindow.

◆ SetOpacity()

void FWindowsWindow::SetOpacity ( const float  InOpacity)
overridevirtual

Sets the opacity of this window

Parameters
InOpacityThe new window opacity represented as a floating point scalar

Reimplemented from FGenericWindow.

◆ SetText()

void FWindowsWindow::SetText ( const TCHAR *const  Text)
overridevirtual

Sets the window text - usually the title but can also be text content for things like controls

Parameters
TextThe window's title or content text

Reimplemented from FGenericWindow.

◆ SetWindowFocus()

void FWindowsWindow::SetWindowFocus ( )
overridevirtual

Sets focus on the native window

Reimplemented from FGenericWindow.

◆ SetWindowMode()

void FWindowsWindow::SetWindowMode ( EWindowMode::Type  NewWindowMode)
overridevirtual

Toggle native window between fullscreen and normal mode

Reimplemented from FGenericWindow.

◆ Show()

void FWindowsWindow::Show ( )
overridevirtual

Native window should make itself visible

Reimplemented from FGenericWindow.

Member Data Documentation

◆ AppWindowClass

const TCHAR FWindowsWindow::AppWindowClass = TEXT("UnrealWindow")
static

Win32 requirement: see CreateWindowEx and RegisterClassEx.


The documentation for this class was generated from the following files: