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... | |
Class that represents a Win32 window.
|
explicit |
Constructor.
windowRegion | Window extent. |
style | The style of the window. |
windowClass | The class to which the window belongs. |
|
explicit |
Constructor.
x | The horizontal position of the top-left corner of the window in screen coordinates. |
y | The vertical position of the top-left corner of the window in screen coordinates. |
width | The horizontal extent of the window in screen coordinates. |
height | The vertical extent of the window in screen coordinates. |
style | The style of the window. |
windowClass | The class name of the window. |
|
explicit |
Constructor.
x | The horizontal position of the top-left corner of the window in screen coordinates. |
y | The vertical position of the top-left corner of the window in screen coordinates. |
width | The horizontal extent of the window in screen coordinates. |
height | The vertical extent of the window in screen coordinates. |
style | The style of the window. |
className | The native class name of the window. |
|
explicit |
Constructor.
nativeHandle | The window handle. |
bool kanzi::win32::Win32Window::setWindowText | ( | const char * | title | ) |
Sets the title of the window.
title | The title to set. |
KZ_NO_DISCARD string kanzi::win32::Win32Window::getWindowText | ( | ) | const |
Gets the title of the window.
|
noexcept |
Moves a window to a new position and sets the window size.
x | The horizontal position of the top-left corner of the window in screen coordinates. |
y | The vertical position of the top-left corner of the window in screen coordinates. |
width | The horizontal extent of the window in screen coordinates. |
height | The vertical extent of the window in screen coordinates. |
repaint | Predicate to do repainting of the window after moving. |
|
noexcept |
Sets the new position of a window.
insertAfter | The window to insert the window after in z-order. |
x | The horizontal position of the top-left corner of the window in screen coordinates. |
y | The vertical position of the top-left corner of the window in screen coordinates. |
width | The horizontal extent of the window in screen coordinates. |
height | The vertical extent of the window in screen coordinates. |
windowFlags | Flags for setting the new window position. |
|
noexcept |
Gets the client extents of the window.
|
noexcept |
Gets the entire extents of the window.
bool kanzi::win32::Win32Window::setWindowPlacement | ( | WINDOWPLACEMENT | windowPlacement | ) |
Sets the current placement of the window.
|
noexcept |
Gets the previous placement of the window.
|
noexcept |
Shows the window.
cmd | How to show the window. |
|
noexcept |
Brings a window to the front of every other window in the z-order.
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.
bool kanzi::win32::Win32Window::screenToClient | ( | LPPOINT | point | ) | const |
Converts the screen coordinates to client-area coordinates for a window.
point | The coordinates to convert. |
bool kanzi::win32::Win32Window::clientToScreen | ( | LPPOINT | point | ) | const |
Converts the client-area coordinates to screen coordinates for a window.
point | The coordinates to convert. |
|
noexcept |
Gets the associated device context handle of a window.
|
noexcept |
Releases the device context handle of a window.
deviceContext | The device context to released. |
|
noexcept |
Sets the attribute value of a window.
index | The type of attribute to set. |
value | The attribute value to set. |
KZ_NO_DISCARD LONG_PTR kanzi::win32::Win32Window::getWindowLongPtr | ( | int | index | ) | const |
Gets the attribute value of a window.
index | The type of attribute to get. |
|
noexcept |
Sets a timer for a window.
id | Timer ID to be set. |
timeout | Time-out value in milliseconds. Clamped by the system-specific minimum and maximum timer values. |
timerProc | Function to notify when the timer elapses. If null, sends the timer message to the application message queue. |
|
noexcept |
Destroys the set timer.
id | Timer ID to destroy. |
|
noexcept |
Gets the display monitor with the largest area of intersection with a window.
flags | Flags to use if the window does not intersect with any display monitor. |
|
noexcept |
Tries to dynamically register the touch input for a window.
user32Lib | The library with which to register the window. |
|
noexcept |
Sets the default touch property for a window.
|
noexcept |
Finds the z ordering for the active window related to all other windows currently visible.
|
inlinenoexcept |
Gets the native window handle.