Kanzi  3.9.7
Kanzi Engine API
kanzi::win32::Win32Window Class Reference

Class that represents a Win32 window. More...

#include <kanzi/core.ui/platform/windowing_ng/win32/win32_window.hpp>

Public Member Functions

bool bringToFront () noexcept
 Brings a window to the front of every other window in the z-order. More...
 
bool clientToScreen (LPPOINT point) const
 Converts the client-area coordinates to screen coordinates for a window. More...
 
bool destroyWindow ()
 Destroys the window and all its associated data by sending destroy request to the window procedure. More...
 
KZ_NO_DISCARD unsigned int findWindowZOrder () const noexcept
 Finds the z ordering for the active window related to all other windows currently visible. More...
 
KZ_NO_DISCARD RECT getClientRect () const noexcept
 Gets the client extents of the window. More...
 
KZ_NO_DISCARD HDC getDC () const noexcept
 Gets the associated device context handle of a window. More...
 
KZ_NO_DISCARD Win32WindowHandle getNativeHandle () const noexcept
 Gets the native window handle. More...
 
KZ_NO_DISCARD LONG_PTR getWindowLongPtr (int index) const
 Gets the attribute value of a window. More...
 
KZ_NO_DISCARD WINDOWPLACEMENT getWindowPlacement () const noexcept
 Gets the previous placement of the window. More...
 
KZ_NO_DISCARD RECT getWindowRect () const noexcept
 Gets the entire extents of the window. More...
 
KZ_NO_DISCARD string getWindowText () const
 Gets the title of the window. More...
 
void killTimer (UINT_PTR id) noexcept
 Destroys the set timer. More...
 
HMONITOR monitorFromWindow (unsigned long flags) noexcept
 Gets the display monitor with the largest area of intersection with a window. More...
 
bool moveWindow (int x, int y, int width, int height, bool repaint) noexcept
 Moves a window to a new position and sets the window size. More...
 
bool releaseDC (Win32DeviceContext &deviceContext) noexcept
 Releases the device context handle of a window. More...
 
bool screenToClient (LPPOINT point) const
 Converts the screen coordinates to client-area coordinates for a window. More...
 
UINT_PTR setTimer (UINT_PTR id, unsigned int timeout, TIMERPROC timerProc) noexcept
 Sets a timer for a window. More...
 
bool setTouchWindowProperty () noexcept
 Sets the default touch property for a window. More...
 
LONG_PTR setWindowLongPtr (int index, LONG_PTR value) noexcept
 Sets the attribute value of a window. More...
 
bool setWindowPlacement (WINDOWPLACEMENT windowPlacement)
 Sets the current placement of the window. More...
 
bool setWindowPosition (Win32WindowHandle insertAfter, int x, int y, int width, int height, unsigned int windowFlags) noexcept
 Sets the new position of a window. More...
 
bool setWindowText (const char *title)
 Sets the title of the window. More...
 
bool showWindow (int cmd) noexcept
 Shows the window. More...
 
bool tryRegisterTouchWindow (const Win32DynamicLibrary &user32Lib) noexcept
 Tries to dynamically register the touch input for a window. More...
 
void updateWindow ()
 Forces the updating of a window by sending the paint request to the window procedure. More...
 
 Win32Window (windowing::Region windowRegion, WindowStyle style, const Win32WindowClass &windowClass)
 Constructor. More...
 
 Win32Window (int x, int y, int width, int height, WindowStyle style, const Win32WindowClass &windowClass)
 Constructor. More...
 
 Win32Window (int x, int y, int width, int height, WindowStyle style, const char *className)
 Constructor. More...
 
 Win32Window (Win32WindowHandle nativeHandle)
 Constructor. More...
 

Detailed Description

Class that represents a Win32 window.

Since
Kanzi 3.9.7

Constructor & Destructor Documentation

kanzi::win32::Win32Window::Win32Window ( windowing::Region  windowRegion,
WindowStyle  style,
const Win32WindowClass windowClass 
)
explicit

Constructor.

Parameters
windowRegionWindow extent.
styleThe style of the window.
windowClassThe class to which the window belongs.
kanzi::win32::Win32Window::Win32Window ( int  x,
int  y,
int  width,
int  height,
WindowStyle  style,
const Win32WindowClass windowClass 
)
explicit

Constructor.

Parameters
xThe horizontal position of the top-left corner of the window in screen coordinates.
yThe vertical position of the top-left corner of the window in screen coordinates.
widthThe horizontal extent of the window in screen coordinates.
heightThe vertical extent of the window in screen coordinates.
styleThe style of the window.
windowClassThe class name of the window.
kanzi::win32::Win32Window::Win32Window ( int  x,
int  y,
int  width,
int  height,
WindowStyle  style,
const char *  className 
)
explicit

Constructor.

Parameters
xThe horizontal position of the top-left corner of the window in screen coordinates.
yThe vertical position of the top-left corner of the window in screen coordinates.
widthThe horizontal extent of the window in screen coordinates.
heightThe vertical extent of the window in screen coordinates.
styleThe style of the window.
classNameThe native class name of the window.
kanzi::win32::Win32Window::Win32Window ( Win32WindowHandle  nativeHandle)
explicit

Constructor.

Parameters
nativeHandleThe window handle.

Member Function Documentation

bool kanzi::win32::Win32Window::setWindowText ( const char *  title)

Sets the title of the window.

Parameters
titleThe title to set.
Returns
On success, true, otherwise false.
KZ_NO_DISCARD string kanzi::win32::Win32Window::getWindowText ( ) const

Gets the title of the window.

Returns
Title of the window.
bool kanzi::win32::Win32Window::moveWindow ( int  x,
int  y,
int  width,
int  height,
bool  repaint 
)
noexcept

Moves a window to a new position and sets the window size.

Parameters
xThe horizontal position of the top-left corner of the window in screen coordinates.
yThe vertical position of the top-left corner of the window in screen coordinates.
widthThe horizontal extent of the window in screen coordinates.
heightThe vertical extent of the window in screen coordinates.
repaintPredicate to do repainting of the window after moving.
bool kanzi::win32::Win32Window::setWindowPosition ( Win32WindowHandle  insertAfter,
int  x,
int  y,
int  width,
int  height,
unsigned int  windowFlags 
)
noexcept

Sets the new position of a window.

Parameters
insertAfterThe window to insert the window after in z-order.
xThe horizontal position of the top-left corner of the window in screen coordinates.
yThe vertical position of the top-left corner of the window in screen coordinates.
widthThe horizontal extent of the window in screen coordinates.
heightThe vertical extent of the window in screen coordinates.
windowFlagsFlags for setting the new window position.
KZ_NO_DISCARD RECT kanzi::win32::Win32Window::getClientRect ( ) const
noexcept

Gets the client extents of the window.

Returns
The extents of the client-area.
KZ_NO_DISCARD RECT kanzi::win32::Win32Window::getWindowRect ( ) const
noexcept

Gets the entire extents of the window.

Returns
The extents of the window.
bool kanzi::win32::Win32Window::setWindowPlacement ( WINDOWPLACEMENT  windowPlacement)

Sets the current placement of the window.

Returns
On success, true, otherwise false.
KZ_NO_DISCARD WINDOWPLACEMENT kanzi::win32::Win32Window::getWindowPlacement ( ) const
noexcept

Gets the previous placement of the window.

Returns
The previous placement.
bool kanzi::win32::Win32Window::showWindow ( int  cmd)
noexcept

Shows the window.

Parameters
cmdHow to show the window.
Returns
On success, true, otherwise false.
bool kanzi::win32::Win32Window::bringToFront ( )
noexcept

Brings a window to the front of every other window in the z-order.

Returns
On success, true, otherwise false.
void kanzi::win32::Win32Window::updateWindow ( )

Forces the updating of a window by sending the paint request to the window procedure.

If the update region is empty, does not send a message.

bool kanzi::win32::Win32Window::destroyWindow ( )

Destroys the window and all its associated data by sending destroy request to the window procedure.

Returns
On success, true, otherwise false.
bool kanzi::win32::Win32Window::screenToClient ( LPPOINT  point) const

Converts the screen coordinates to client-area coordinates for a window.

Parameters
pointThe coordinates to convert.
Returns
On success, true, otherwise false.
bool kanzi::win32::Win32Window::clientToScreen ( LPPOINT  point) const

Converts the client-area coordinates to screen coordinates for a window.

Parameters
pointThe coordinates to convert.
Returns
On success, true, otherwise false.
KZ_NO_DISCARD HDC kanzi::win32::Win32Window::getDC ( ) const
noexcept

Gets the associated device context handle of a window.

Returns
Device context handle.
bool kanzi::win32::Win32Window::releaseDC ( Win32DeviceContext deviceContext)
noexcept

Releases the device context handle of a window.

Parameters
deviceContextThe device context to released.
Returns
On success, true, otherwise false.
LONG_PTR kanzi::win32::Win32Window::setWindowLongPtr ( int  index,
LONG_PTR  value 
)
noexcept

Sets the attribute value of a window.

Parameters
indexThe type of attribute to set.
valueThe attribute value to set.
KZ_NO_DISCARD LONG_PTR kanzi::win32::Win32Window::getWindowLongPtr ( int  index) const

Gets the attribute value of a window.

Parameters
indexThe type of attribute to get.
Returns
The attribute value of a window.
UINT_PTR kanzi::win32::Win32Window::setTimer ( UINT_PTR  id,
unsigned int  timeout,
TIMERPROC  timerProc 
)
noexcept

Sets a timer for a window.

Parameters
idTimer ID to be set.
timeoutTime-out value in milliseconds. Clamped by the system-specific minimum and maximum timer values.
timerProcFunction to notify when the timer elapses. If null, sends the timer message to the application message queue.
void kanzi::win32::Win32Window::killTimer ( UINT_PTR  id)
noexcept

Destroys the set timer.

Parameters
idTimer ID to destroy.
HMONITOR kanzi::win32::Win32Window::monitorFromWindow ( unsigned long  flags)
noexcept

Gets the display monitor with the largest area of intersection with a window.

Parameters
flagsFlags to use if the window does not intersect with any display monitor.
Returns
The display monitor.
bool kanzi::win32::Win32Window::tryRegisterTouchWindow ( const Win32DynamicLibrary user32Lib)
noexcept

Tries to dynamically register the touch input for a window.

Parameters
user32LibThe library with which to register the window.
Returns
On success, true, otherwise false.
bool kanzi::win32::Win32Window::setTouchWindowProperty ( )
noexcept

Sets the default touch property for a window.

Returns
On success, true, otherwise false.
KZ_NO_DISCARD unsigned int kanzi::win32::Win32Window::findWindowZOrder ( ) const
noexcept

Finds the z ordering for the active window related to all other windows currently visible.

Returns
The z ordering.
KZ_NO_DISCARD Win32WindowHandle kanzi::win32::Win32Window::getNativeHandle ( ) const
inlinenoexcept

Gets the native window handle.

Returns
The native window handle.

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