Interface for Native Window Operations. More...
#include <SNativeWnd-i.h>
Public Member Functions | |
| long | AddRef () PURE |
| Add reference. | |
| long | Release () PURE |
| Release reference. | |
| void | OnFinalRelease () PURE |
| Final release of the object. | |
| HWND | CreateNative (LPCTSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, int nID, LPVOID lpParam) PURE |
| Creates a Native window. | |
| HWND | GetHwnd () PURE |
| Retrieves the handle to the window. | |
| BOOL | SubclassWindow (HWND hWnd) PURE |
| Subclasses an existing window with the SNativeWnd object. | |
| HWND | UnsubclassWindow (BOOL bForce) PURE |
| Unsubclasses the window. | |
| const MSG * | GetCurrentMessage () SCONST PURE |
| Retrieves the current window message object. | |
| int | GetDlgCtrlID () SCONST PURE |
| Retrieves the window ID. | |
| DWORD | GetStyle () SCONST PURE |
| Retrieves the window style. | |
| DWORD | GetExStyle () SCONST PURE |
| Retrieves the extended window style. | |
| LONG_PTR | GetWindowLongPtr (int nIndex) SCONST PURE |
| Retrieves the long pointer value at the specified index. | |
| LONG_PTR | SetWindowLongPtr (int nIndex, LONG_PTR dwNewLong) PURE |
| Sets the long pointer value at the specified index. | |
| HWND | GetParent () PURE |
| Retrieves the handle to the parent window. | |
| HWND | SetParent (HWND hWndNewParent) PURE |
| Sets the handle to the parent window. | |
| BOOL | IsWindowEnabled () SCONST PURE |
| Checks if the window is enabled. | |
| BOOL | ModifyStyle (DWORD dwRemove, DWORD dwAdd, UINT nFlags) PURE |
| Modifies the window style. | |
| BOOL | ModifyStyleEx (DWORD dwRemove, DWORD dwAdd, UINT nFlags) PURE |
| Modifies the extended window style. | |
| BOOL | SetWindowPos (HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags) PURE |
| Sets the window position. | |
| BOOL | CenterWindow (HWND hWndCenter) PURE |
| Centers the window relative to another window. | |
| BOOL | DestroyWindow () PURE |
| Destroys the window. | |
| BOOL | IsWindow () SCONST PURE |
| Checks if the handle is a valid window handle. | |
| BOOL | Invalidate (BOOL bErase) PURE |
| Invalidates the entire window. | |
| BOOL | InvalidateRect (LPCRECT lpRect, BOOL bErase) PURE |
| Invalidates a specified rectangle of the window. | |
| BOOL | GetWindowRect (LPRECT lpRect) SCONST PURE |
| Retrieves the window rectangle. | |
| BOOL | GetClientRect (LPRECT lpRect) SCONST PURE |
| Retrieves the client rectangle. | |
| BOOL | ClientToScreen (LPPOINT lpPoint) SCONST PURE |
| Converts client coordinates to screen coordinates. | |
| BOOL | ClientToScreen2 (LPRECT lpRect) SCONST PURE |
| Converts client rectangle coordinates to screen coordinates. | |
| BOOL | ScreenToClient (LPPOINT lpPoint) SCONST PURE |
| Converts screen coordinates to client coordinates. | |
| BOOL | ScreenToClient2 (LPRECT lpRect) SCONST PURE |
| Converts screen rectangle coordinates to client coordinates. | |
| int | MapWindowPoints (HWND hWndTo, LPPOINT lpPoint, UINT nCount) SCONST PURE |
| Maps a set of points from one window to another. | |
| int | MapWindowRect (HWND hWndTo, LPRECT lpRect) SCONST PURE |
| Maps a rectangle from one window to another. | |
| UINT_PTR | SetTimer (UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)) PURE |
| Sets a timer for the window. | |
| BOOL | KillTimer (UINT_PTR nIDEvent) PURE |
| Kills a timer for the window. | |
| HDC | GetDC () PURE |
| Retrieves a device context for the window. | |
| HDC | GetWindowDC () PURE |
| Retrieves a device context for the entire window. | |
| int | ReleaseDC (HDC hDC) PURE |
| Releases a device context. | |
| BOOL | CreateCaret (HBITMAP hBitmap, int nWidth, int nHeight) PURE |
| Creates a caret for the window. | |
| BOOL | HideCaret () PURE |
| Hides the caret. | |
| BOOL | ShowCaret () PURE |
| Shows the caret. | |
| HWND | GetCapture () PURE |
| Retrieves the handle to the window that has captured the mouse. | |
| HWND | SetCapture () PURE |
| Sets the window to capture the mouse input. | |
| BOOL | ReleaseCapture () PURE |
| Releases the mouse capture. | |
| HWND | SetFocus () PURE |
| Sets the input focus to the window. | |
| LRESULT | SendMessage (UINT message, WPARAM wParam, LPARAM lParam) PURE |
| Sends a message to the window. | |
| BOOL | PostMessage (UINT message, WPARAM wParam, LPARAM lParam) PURE |
| Posts a message to the window. | |
| BOOL | SendNotifyMessage (UINT message, WPARAM wParam, LPARAM lParam) PURE |
| Sends a notify message to the window. | |
| BOOL | SetWindowText (LPCTSTR lpszString) PURE |
| Sets the window text. | |
| int | GetWindowText (LPTSTR lpszStringBuf, int nMaxCount) SCONST PURE |
| Retrieves the window text. | |
| BOOL | IsIconic () SCONST PURE |
| Checks if the window is iconic (minimized). | |
| BOOL | IsZoomed () SCONST PURE |
| Checks if the window is zoomed (maximized). | |
| BOOL | IsWindowVisible () SCONST PURE |
| Checks if the window is visible. | |
| BOOL | MoveWindow (int x, int y, int nWidth, int nHeight, BOOL bRepaint) PURE |
| Moves the window to the specified position and resizes it. | |
| BOOL | MoveWindow2 (LPCRECT lpRect, BOOL bRepaint) PURE |
| Moves the window to the specified position and resizes it using a rectangle. | |
| BOOL | ShowWindow (int nCmdShow) PURE |
| Sets the show state of the window. | |
| int | SetWindowRgn (HRGN hRgn, BOOL bRedraw) PURE |
| Sets the window region. | |
| BOOL | SetLayeredWindowAttributes (COLORREF crKey, BYTE bAlpha, DWORD dwFlags) PURE |
| Sets the layered window attributes. | |
| BOOL | UpdateLayeredWindow (HDC hdcDst, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags) PURE |
| Updates the layered window. | |
| void | SetMsgHandler (FunMsgHandler fun, void *ctx) PURE |
| Sets the message handler for the window. | |
| MsgHandlerInfo * | GetMsgHandler () PURE |
| Retrieves the message handler for the window. | |
Public Member Functions inherited from IObjRef | |
| long | AddRef () PURE |
| Increases the reference count. | |
| long | Release () PURE |
| Decreases the reference count. | |
| void | OnFinalRelease () PURE |
| Called when the reference count reaches zero and the object is about to be released. | |
Interface for Native Window Operations.
This interface defines the methods for managing native windows, including message handling and event arguments.
Definition at line 52 of file SNativeWnd-i.h.
| long INativeWnd::AddRef | ( | ) |
Add reference.
Increments the reference count of the object.
Implemented in SMenuEx, and TObjRefImpl< INativeWnd >.
| BOOL INativeWnd::CenterWindow | ( | HWND | hWndCenter | ) |
Centers the window relative to another window.
| hWndCenter | Handle to the window to center relative to. |
Implemented in SNativeWnd.
| BOOL INativeWnd::ClientToScreen | ( | LPPOINT | lpPoint | ) |
Converts client coordinates to screen coordinates.
| [in] |
out] lpPoint Point to convert.
Implemented in SNativeWnd.
| BOOL INativeWnd::ClientToScreen2 | ( | LPRECT | lpRect | ) |
Converts client rectangle coordinates to screen coordinates.
| [in] |
out] lpRect Rectangle to convert.
Implemented in SNativeWnd.
| BOOL INativeWnd::CreateCaret | ( | HBITMAP | hBitmap, |
| int | nWidth, | ||
| int | nHeight ) |
Creates a caret for the window.
| hBitmap | Handle to the bitmap for the caret. |
| nWidth | Width of the caret. |
| nHeight | Height of the caret. |
Implemented in SNativeWnd.
| HWND INativeWnd::CreateNative | ( | LPCTSTR | lpWindowName, |
| DWORD | dwStyle, | ||
| DWORD | dwExStyle, | ||
| int | x, | ||
| int | y, | ||
| int | nWidth, | ||
| int | nHeight, | ||
| HWND | hWndParent, | ||
| int | nID, | ||
| LPVOID | lpParam ) |
Creates a Native window.
| lpWindowName | Name of the window. |
| dwStyle | Window style. |
| dwExStyle | Extended window style. |
| x | X position of the window. |
| y | Y position of the window. |
| nWidth | Width of the window. |
| nHeight | Height of the window. |
| hWndParent | Handle to the parent window. |
| nID | Control ID of the window. |
| lpParam | Additional parameters. |
Implemented in SNativeWnd.
| BOOL INativeWnd::DestroyWindow | ( | ) |
Destroys the window.
Implemented in SHostWnd, and SNativeWnd.
| HWND INativeWnd::GetCapture | ( | ) |
Retrieves the handle to the window that has captured the mouse.
Implemented in SNativeWnd.
| BOOL INativeWnd::GetClientRect | ( | LPRECT | lpRect | ) |
Retrieves the client rectangle.
| [out] | lpRect | Rectangle to receive the client rectangle. |
Implemented in SNativeWnd.
| const MSG * INativeWnd::GetCurrentMessage | ( | ) |
Retrieves the current window message object.
Implemented in SNativeWnd.
| HDC INativeWnd::GetDC | ( | ) |
Retrieves a device context for the window.
Implemented in SNativeWnd.
| int INativeWnd::GetDlgCtrlID | ( | ) |
| DWORD INativeWnd::GetExStyle | ( | ) |
| HWND INativeWnd::GetHwnd | ( | ) |
| MsgHandlerInfo * INativeWnd::GetMsgHandler | ( | ) |
Retrieves the message handler for the window.
Implemented in SNativeWnd.
| HWND INativeWnd::GetParent | ( | ) |
Retrieves the handle to the parent window.
Implemented in SNativeWnd.
| DWORD INativeWnd::GetStyle | ( | ) |
| HDC INativeWnd::GetWindowDC | ( | ) |
Retrieves a device context for the entire window.
Implemented in SNativeWnd.
| LONG_PTR INativeWnd::GetWindowLongPtr | ( | int | nIndex | ) |
Retrieves the long pointer value at the specified index.
| nIndex | Index of the value to retrieve. |
Implemented in SNativeWnd.
| BOOL INativeWnd::GetWindowRect | ( | LPRECT | lpRect | ) |
Retrieves the window rectangle.
| [out] | lpRect | Rectangle to receive the window rectangle. |
Implemented in SNativeWnd.
| int INativeWnd::GetWindowText | ( | LPTSTR | lpszStringBuf, |
| int | nMaxCount ) |
Retrieves the window text.
| lpszStringBuf | Buffer to receive the window text. |
| nMaxCount | Maximum number of characters to copy to the buffer. |
Implemented in SNativeWnd.
| BOOL INativeWnd::HideCaret | ( | ) |
| BOOL INativeWnd::Invalidate | ( | BOOL | bErase | ) |
Invalidates the entire window.
| bErase | Flag indicating if the background should be erased. |
Implemented in SNativeWnd.
| BOOL INativeWnd::InvalidateRect | ( | LPCRECT | lpRect, |
| BOOL | bErase ) |
Invalidates a specified rectangle of the window.
| lpRect | Rectangle to invalidate. |
| bErase | Flag indicating if the background should be erased. |
Implemented in SNativeWnd.
| BOOL INativeWnd::IsIconic | ( | ) |
Checks if the window is iconic (minimized).
Implemented in SNativeWnd.
| BOOL INativeWnd::IsWindow | ( | ) |
Checks if the handle is a valid window handle.
Implemented in SNativeWnd.
| BOOL INativeWnd::IsWindowEnabled | ( | ) |
Checks if the window is enabled.
Implemented in SNativeWnd.
| BOOL INativeWnd::IsWindowVisible | ( | ) |
Checks if the window is visible.
Implemented in SNativeWnd.
| BOOL INativeWnd::IsZoomed | ( | ) |
Checks if the window is zoomed (maximized).
Implemented in SNativeWnd.
| BOOL INativeWnd::KillTimer | ( | UINT_PTR | nIDEvent | ) |
Kills a timer for the window.
| nIDEvent | Timer ID. |
Implemented in SNativeWnd.
| int INativeWnd::MapWindowPoints | ( | HWND | hWndTo, |
| LPPOINT | lpPoint, | ||
| UINT | nCount ) |
Maps a set of points from one window to another.
| hWndTo | Handle to the destination window. | |
| [in] |
out] lpPoint Array of points to map.
| nCount | Number of points. |
Implemented in SNativeWnd.
| int INativeWnd::MapWindowRect | ( | HWND | hWndTo, |
| LPRECT | lpRect ) |
Maps a rectangle from one window to another.
| hWndTo | Handle to the destination window. | |
| [in] |
out] lpRect Rectangle to map.
Implemented in SNativeWnd.
| BOOL INativeWnd::ModifyStyle | ( | DWORD | dwRemove, |
| DWORD | dwAdd, | ||
| UINT | nFlags ) |
Modifies the window style.
| dwRemove | Styles to remove. |
| dwAdd | Styles to add. |
| nFlags | Window positioning flags. |
Implemented in SNativeWnd.
| BOOL INativeWnd::ModifyStyleEx | ( | DWORD | dwRemove, |
| DWORD | dwAdd, | ||
| UINT | nFlags ) |
Modifies the extended window style.
| dwRemove | Styles to remove. |
| dwAdd | Styles to add. |
| nFlags | Window positioning flags. |
Implemented in SNativeWnd.
| BOOL INativeWnd::MoveWindow | ( | int | x, |
| int | y, | ||
| int | nWidth, | ||
| int | nHeight, | ||
| BOOL | bRepaint ) |
Moves the window to the specified position and resizes it.
| x | X position of the window. |
| y | Y position of the window. |
| nWidth | Width of the window. |
| nHeight | Height of the window. |
| bRepaint | Flag indicating if the window should be repainted. |
Implemented in SNativeWnd.
| BOOL INativeWnd::MoveWindow2 | ( | LPCRECT | lpRect, |
| BOOL | bRepaint ) |
Moves the window to the specified position and resizes it using a rectangle.
| lpRect | Rectangle defining the new position and size of the window. |
| bRepaint | Flag indicating if the window should be repainted. |
Implemented in SNativeWnd.
| void INativeWnd::OnFinalRelease | ( | ) |
Final release of the object.
Final release of the object, performing cleanup if necessary.
Implemented in SMenuEx, and TObjRefImpl< INativeWnd >.
| BOOL INativeWnd::PostMessage | ( | UINT | message, |
| WPARAM | wParam, | ||
| LPARAM | lParam ) |
Posts a message to the window.
| message | Message ID. |
| wParam | WPARAM for the message. |
| lParam | LPARAM for the message. |
Implemented in SNativeWnd.
| long INativeWnd::Release | ( | ) |
Release reference.
Decrements the reference count of the object.
Implemented in SMenuEx, and TObjRefImpl< INativeWnd >.
| BOOL INativeWnd::ReleaseCapture | ( | ) |
Releases the mouse capture.
Implemented in SNativeWnd.
| int INativeWnd::ReleaseDC | ( | HDC | hDC | ) |
Releases a device context.
| hDC | Handle to the device context to release. |
Implemented in SNativeWnd.
| BOOL INativeWnd::ScreenToClient | ( | LPPOINT | lpPoint | ) |
Converts screen coordinates to client coordinates.
| [in] |
out] lpPoint Point to convert.
Implemented in SNativeWnd.
| BOOL INativeWnd::ScreenToClient2 | ( | LPRECT | lpRect | ) |
Converts screen rectangle coordinates to client coordinates.
| [in] |
out] lpRect Rectangle to convert.
Implemented in SNativeWnd.
| LRESULT INativeWnd::SendMessage | ( | UINT | message, |
| WPARAM | wParam, | ||
| LPARAM | lParam ) |
Sends a message to the window.
| message | Message ID. |
| wParam | WPARAM for the message. |
| lParam | LPARAM for the message. |
Implemented in SNativeWnd.
| BOOL INativeWnd::SendNotifyMessage | ( | UINT | message, |
| WPARAM | wParam, | ||
| LPARAM | lParam ) |
Sends a notify message to the window.
| message | Message ID. |
| wParam | WPARAM for the message. |
| lParam | LPARAM for the message. |
Implemented in SNativeWnd.
| HWND INativeWnd::SetCapture | ( | ) |
Sets the window to capture the mouse input.
Implemented in SNativeWnd.
| HWND INativeWnd::SetFocus | ( | ) |
Sets the input focus to the window.
Implemented in SNativeWnd.
| BOOL INativeWnd::SetLayeredWindowAttributes | ( | COLORREF | crKey, |
| BYTE | bAlpha, | ||
| DWORD | dwFlags ) |
Sets the layered window attributes.
| crKey | Color key for transparency. |
| bAlpha | Alpha value for transparency. |
| dwFlags | Flags for the layered window attributes. |
Implemented in SNativeWnd.
| void INativeWnd::SetMsgHandler | ( | FunMsgHandler | fun, |
| void * | ctx ) |
Sets the message handler for the window.
| fun | Function pointer to the message handler. |
| ctx | Context pointer for the message handler. |
Implemented in SNativeWnd.
| HWND INativeWnd::SetParent | ( | HWND | hWndNewParent | ) |
Sets the handle to the parent window.
| hWndNewParent | Handle to the new parent window. |
Implemented in SNativeWnd.
| UINT_PTR INativeWnd::SetTimer | ( | UINT_PTR | nIDEvent, |
| UINT | nElapse, | ||
| void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD) | ) |
Sets a timer for the window.
| nIDEvent | Timer ID. |
| nElapse | Elapse time in milliseconds. |
| lpfnTimer | Timer callback function, if NULL, a WM_TIMER message is generated. |
Implemented in SNativeWnd.
| LONG_PTR INativeWnd::SetWindowLongPtr | ( | int | nIndex, |
| LONG_PTR | dwNewLong ) |
Sets the long pointer value at the specified index.
| nIndex | Index of the value to set. |
| dwNewLong | New long pointer value. |
Implemented in SNativeWnd.
| BOOL INativeWnd::SetWindowPos | ( | HWND | hWndInsertAfter, |
| int | x, | ||
| int | y, | ||
| int | cx, | ||
| int | cy, | ||
| UINT | nFlags ) |
Sets the window position.
| hWndInsertAfter | Handle to the window to insert after. |
| x | X position of the window. |
| y | Y position of the window. |
| cx | Width of the window. |
| cy | Height of the window. |
| nFlags | Window positioning flags. |
Implemented in SNativeWnd.
| int INativeWnd::SetWindowRgn | ( | HRGN | hRgn, |
| BOOL | bRedraw ) |
Sets the window region.
| hRgn | Handle to the region. |
| bRedraw | Flag indicating if the window should be redrawn. |
Implemented in SNativeWnd.
| BOOL INativeWnd::SetWindowText | ( | LPCTSTR | lpszString | ) |
Sets the window text.
| lpszString | String to set as the window text. |
Implemented in SNativeWnd.
| BOOL INativeWnd::ShowCaret | ( | ) |
| BOOL INativeWnd::ShowWindow | ( | int | nCmdShow | ) |
Sets the show state of the window.
| nCmdShow | Command to show the window (e.g., SW_SHOW, SW_HIDE). |
Implemented in SHostWnd, and SNativeWnd.
| BOOL INativeWnd::SubclassWindow | ( | HWND | hWnd | ) |
Subclasses an existing window with the SNativeWnd object.
| hWnd | Handle to the window to subclass. |
Implemented in SNativeWnd.
| HWND INativeWnd::UnsubclassWindow | ( | BOOL | bForce | ) |
Unsubclasses the window.
| bForce | If TRUE, forces the unsubclassing even if the current window procedure is not SNativeWnd's. |
Implemented in SNativeWnd.
| BOOL INativeWnd::UpdateLayeredWindow | ( | HDC | hdcDst, |
| POINT * | pptDst, | ||
| SIZE * | psize, | ||
| HDC | hdcSrc, | ||
| POINT * | pptSrc, | ||
| COLORREF | crKey, | ||
| BLENDFUNCTION * | pblend, | ||
| DWORD | dwFlags ) |
Updates the layered window.
| hdcDst | Destination device context. |
| pptDst | Destination point. |
| psize | Size of the destination. |
| hdcSrc | Source device context. |
| pptSrc | Source point. |
| crKey | Color key for transparency. |
| pblend | Blend function. |
| dwFlags | Flags for the update. |
Implemented in SNativeWnd.