soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SNativeWnd Class Reference

Class for managing native window operations. More...

#include <SNativeWnd.h>

Inheritance diagram for SNativeWnd:
TObjRefImpl< INativeWnd > INativeWnd IObjRef SMenuODWnd STipCtrl

Public Member Functions

int GetID () SCONST
 Retrieves the window ID.
 
void SetID (int nID)
 Sets the window ID.
 
HWND CreateNative (LPCTSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, int nID=0, LPVOID lpParam=0) OVERRIDE
 Creates a native window.
 
HWND GetHwnd () OVERRIDE
 Retrieves the handle to the window.
 
BOOL SubclassWindow (HWND hWnd) OVERRIDE
 Subclasses an existing window.
 
HWND UnsubclassWindow (BOOL bForce=FALSE) OVERRIDE
 Unsubclasses a window.
 
const MSG * GetCurrentMessage () SCONST OVERRIDE
 Retrieves the current message being processed.
 
int GetDlgCtrlID () SCONST OVERRIDE
 Retrieves the dialog control ID.
 
DWORD GetStyle () SCONST OVERRIDE
 Retrieves the window style.
 
DWORD GetExStyle () SCONST OVERRIDE
 Retrieves the extended window style.
 
LONG_PTR GetWindowLongPtr (int nIndex) SCONST OVERRIDE
 Retrieves the long pointer value at the specified index.
 
LONG_PTR SetWindowLongPtr (int nIndex, LONG_PTR dwNewLong) OVERRIDE
 Sets the long pointer value at the specified index.
 
HWND GetParent () OVERRIDE
 Retrieves the handle to the parent window.
 
HWND SetParent (HWND hWndNewParent) OVERRIDE
 Sets the handle to the parent window.
 
BOOL IsWindowEnabled () SCONST OVERRIDE
 Checks if the window is enabled.
 
BOOL ModifyStyle (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0) OVERRIDE
 Modifies the window style.
 
BOOL ModifyStyleEx (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0) OVERRIDE
 Modifies the extended window style.
 
BOOL SetWindowPos (HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags) OVERRIDE
 Sets the window position.
 
BOOL CenterWindow (HWND hWndCenter=0) OVERRIDE
 Centers the window relative to another window.
 
BOOL DestroyWindow () OVERRIDE
 Destroys the window.
 
BOOL IsWindow () SCONST OVERRIDE
 Checks if the handle is a valid window handle.
 
BOOL Invalidate (BOOL bErase=TRUE) OVERRIDE
 Invalidates the entire window.
 
BOOL InvalidateRect (LPCRECT lpRect, BOOL bErase=TRUE) OVERRIDE
 Invalidates a specified rectangle of the window.
 
BOOL GetWindowRect (LPRECT lpRect) SCONST OVERRIDE
 Retrieves the window rectangle.
 
BOOL GetClientRect (LPRECT lpRect) SCONST OVERRIDE
 Retrieves the client rectangle.
 
BOOL ClientToScreen (LPPOINT lpPoint) SCONST OVERRIDE
 Converts client coordinates to screen coordinates.
 
BOOL ClientToScreen2 (LPRECT lpRect) SCONST OVERRIDE
 Converts client rectangle coordinates to screen coordinates.
 
BOOL ScreenToClient (LPPOINT lpPoint) SCONST OVERRIDE
 Converts screen coordinates to client coordinates.
 
BOOL ScreenToClient2 (LPRECT lpRect) SCONST OVERRIDE
 Converts screen rectangle coordinates to client coordinates.
 
int MapWindowPoints (HWND hWndTo, LPPOINT lpPoint, UINT nCount) SCONST OVERRIDE
 Maps points from one window to another.
 
int MapWindowRect (HWND hWndTo, LPRECT lpRect) SCONST OVERRIDE
 Maps a rectangle from one window to another.
 
UINT_PTR SetTimer (UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL) OVERRIDE
 Sets a timer for the window.
 
BOOL KillTimer (UINT_PTR nIDEvent) OVERRIDE
 Kills a timer for the window.
 
HDC GetDC () OVERRIDE
 Retrieves a device context for the window.
 
HDC GetWindowDC () OVERRIDE
 Retrieves a device context for the entire window.
 
int ReleaseDC (HDC hDC) OVERRIDE
 Releases a device context.
 
BOOL CreateCaret (HBITMAP hBitmap, int nWidth, int nHeight) OVERRIDE
 Creates a caret for the window.
 
BOOL HideCaret () OVERRIDE
 Hides the caret.
 
BOOL ShowCaret () OVERRIDE
 Shows the caret.
 
HWND GetCapture () OVERRIDE
 Retrieves the handle to the window that has captured the mouse.
 
HWND SetCapture () OVERRIDE
 Sets the window to capture the mouse.
 
BOOL ReleaseCapture () OVERRIDE
 Releases the mouse capture.
 
HWND SetFocus () OVERRIDE
 Sets the input focus to the window.
 
LRESULT SendMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
 Sends a message to the window.
 
BOOL PostMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
 Posts a message to the window.
 
BOOL SendNotifyMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
 Sends a notify message to the window.
 
BOOL SetWindowText (LPCTSTR lpszString) OVERRIDE
 Sets the window text.
 
int GetWindowText (LPTSTR lpszStringBuf, int nMaxCount) SCONST OVERRIDE
 Retrieves the window text.
 
BOOL IsIconic () SCONST OVERRIDE
 Checks if the window is iconic (minimized).
 
BOOL IsZoomed () SCONST OVERRIDE
 Checks if the window is zoomed (maximized).
 
BOOL IsWindowVisible () SCONST OVERRIDE
 Checks if the window is visible.
 
BOOL MoveWindow (int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE) OVERRIDE
 Moves the window to the specified position and resizes it.
 
BOOL MoveWindow2 (LPCRECT lpRect, BOOL bRepaint=TRUE) OVERRIDE
 Moves the window to the specified position and resizes it using a rectangle.
 
BOOL ShowWindow (int nCmdShow) OVERRIDE
 Sets the show state of the window.
 
int SetWindowRgn (HRGN hRgn, BOOL bRedraw=TRUE) OVERRIDE
 Sets the window region.
 
BOOL SetLayeredWindowAttributes (COLORREF crKey, BYTE bAlpha, DWORD dwFlags) OVERRIDE
 Sets the layered window attributes.
 
BOOL UpdateLayeredWindow (HDC hdcDst, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags) OVERRIDE
 Updates the layered window.
 
void SetMsgHandler (FunMsgHandler fun, void *ctx) OVERRIDE
 Sets the message handler for the window.
 
MsgHandlerInfoGetMsgHandler () OVERRIDE
 Retrieves the message handler for the window.
 
LRESULT DefWindowProc ()
 Calls the default window procedure.
 
LRESULT ForwardNotifications (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 Forwards notifications to the appropriate handler.
 
LRESULT ReflectNotifications (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 Reflects notifications to the appropriate handler.
 
virtual BOOL ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID=0)
 Processes a window message.
 
- Public Member Functions inherited from TObjRefImpl< INativeWnd >
 TObjRefImpl ()
 Constructor that initializes the reference count to 1.
 
virtual ~TObjRefImpl ()
 Virtual destructor.
 
long AddRef () override
 Increments the reference count.
 
long Release () override
 Decrements the reference count and deletes the object if the count reaches zero.
 
void OnFinalRelease () override
 Deletes the object.
 
- 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.
 

Static Public Member Functions

static ATOM RegisterSimpleWnd (HINSTANCE hInst, LPCTSTR pszSimpleWndName, BOOL bImeWnd)
 Registers a simple window class.
 
static void InitWndClass (HINSTANCE hInst, LPCTSTR pszSimpleWndName, BOOL bImeWnd)
 Initializes the window class.
 
static BOOL DefaultReflectionHandler (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult)
 Default reflection handler for notifications.
 

Public Attributes

HWND m_hWnd
 Handle to the window.
 

Protected Member Functions

LRESULT DefWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Calls the default window procedure with specific parameters.
 
virtual void OnFinalMessage (HWND hWnd)
 Handles the final message for the window.
 

Static Protected Member Functions

static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 Window procedure callback function.
 
static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 Start window procedure callback function (executed once).
 

Protected Attributes

const MSG * m_pCurrentMsg
 Pointer to the current message.
 
BOOL m_bDestoryed
 Flag indicating if the window is destroyed.
 
MsgHandlerInfo m_msgHandlerInfo
 Message handler information.
 
tagThunk * m_pThunk
 Thunk structure.
 
WNDPROC m_pfnSuperWindowProc
 Pointer to the superclass window procedure.
 
- Protected Attributes inherited from TObjRefImpl< INativeWnd >
LONG m_cRef
 Reference count.
 

Detailed Description

Class for managing native window operations.

This class provides methods for creating, subclassing, and managing native Windows, as well as handling window messages and notifications.

Definition at line 126 of file SNativeWnd.h.

Constructor & Destructor Documentation

◆ SNativeWnd()

SNativeWnd::SNativeWnd ( )

Definition at line 187 of file SNativeWnd.cpp.

◆ ~SNativeWnd()

SNativeWnd::~SNativeWnd ( void )
virtual

Definition at line 198 of file SNativeWnd.cpp.

Member Function Documentation

◆ CenterWindow()

BOOL SNativeWnd::CenterWindow ( HWND hWndCenter = 0)

Centers the window relative to another window.

Parameters
hWndCenterHandle to the window to center relative to.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 527 of file SNativeWnd.cpp.

◆ ClientToScreen()

BOOL SNativeWnd::ClientToScreen ( LPPOINT lpPoint)

Converts client coordinates to screen coordinates.

Parameters
lpPointPoint to convert.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 857 of file SNativeWnd.cpp.

◆ ClientToScreen2()

BOOL SNativeWnd::ClientToScreen2 ( LPRECT lpRect)

Converts client rectangle coordinates to screen coordinates.

Parameters
lpRectRectangle to convert.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 849 of file SNativeWnd.cpp.

◆ CreateCaret()

BOOL SNativeWnd::CreateCaret ( HBITMAP hBitmap,
int nWidth,
int nHeight )

Creates a caret for the window.

Parameters
hBitmapHandle to the bitmap for the caret.
nWidthWidth of the caret.
nHeightHeight of the caret.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 787 of file SNativeWnd.cpp.

◆ CreateNative()

HWND SNativeWnd::CreateNative ( LPCTSTR lpWindowName,
DWORD dwStyle,
DWORD dwExStyle,
int x,
int y,
int nWidth,
int nHeight,
HWND hWndParent,
int nID = 0,
LPVOID lpParam = 0 )

Creates a native window.

Parameters
lpWindowNameName of the window.
dwStyleWindow style.
dwExStyleExtended window style.
xX position of the window.
yY position of the window.
nWidthWidth of the window.
nHeightHeight of the window.
hWndParentHandle to the parent window.
nIDControl ID of the window.
lpParamPointer to creation parameters.
Returns
HWND Handle to the created window.

Implements INativeWnd.

Definition at line 219 of file SNativeWnd.cpp.

◆ DefaultReflectionHandler()

BOOL SNativeWnd::DefaultReflectionHandler ( HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam,
LRESULT & lResult )
static

Default reflection handler for notifications.

Parameters
hWndHandle to the window.
uMsgMessage identifier.
wParamWPARAM for the message.
lParamLPARAM for the message.
lResultResult of the message processing.
Returns
BOOL TRUE if the message was handled, FALSE otherwise.

Definition at line 481 of file SNativeWnd.cpp.

◆ DefWindowProc() [1/2]

LRESULT SNativeWnd::DefWindowProc ( )

Calls the default window procedure.

Returns
LRESULT Result of the default window procedure.

Definition at line 518 of file SNativeWnd.cpp.

◆ DefWindowProc() [2/2]

LRESULT SNativeWnd::DefWindowProc ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
protected

Calls the default window procedure with specific parameters.

Parameters
uMsgMessage identifier.
wParamWPARAM for the message.
lParamLPARAM for the message.
Returns
LRESULT Result of the default window procedure.

Definition at line 513 of file SNativeWnd.cpp.

◆ DestroyWindow()

BOOL SNativeWnd::DestroyWindow ( )

Destroys the window.

Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 892 of file SNativeWnd.cpp.

◆ ForwardNotifications()

LRESULT SNativeWnd::ForwardNotifications ( UINT uMsg,
WPARAM wParam,
LPARAM lParam,
BOOL & bHandled )

Forwards notifications to the appropriate handler.

Parameters
uMsgMessage identifier.
wParamWPARAM for the message.
lParamLPARAM for the message.
bHandledFlag indicating if the message was handled.
Returns
LRESULT Result of the message processing.

Definition at line 382 of file SNativeWnd.cpp.

◆ GetCapture()

HWND SNativeWnd::GetCapture ( )

Retrieves the handle to the window that has captured the mouse.

Returns
HWND Handle to the capturing window.

Implements INativeWnd.

Definition at line 765 of file SNativeWnd.cpp.

◆ GetClientRect()

BOOL SNativeWnd::GetClientRect ( LPRECT lpRect)

Retrieves the client rectangle.

Parameters
lpRectRectangle to receive the client rectangle.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 863 of file SNativeWnd.cpp.

◆ GetCurrentMessage()

const MSG * SNativeWnd::GetCurrentMessage ( )

Retrieves the current message being processed.

Returns
const MSG* Pointer to the current message.

Implements INativeWnd.

Definition at line 952 of file SNativeWnd.cpp.

◆ GetDC()

HDC SNativeWnd::GetDC ( )

Retrieves a device context for the window.

Returns
HDC Handle to the device context.

Implements INativeWnd.

Definition at line 805 of file SNativeWnd.cpp.

◆ GetDlgCtrlID()

int SNativeWnd::GetDlgCtrlID ( )

Retrieves the dialog control ID.

Returns
int Dialog control ID.

Implements INativeWnd.

Definition at line 946 of file SNativeWnd.cpp.

◆ GetExStyle()

DWORD SNativeWnd::GetExStyle ( )

Retrieves the extended window style.

Returns
DWORD Extended window style.

Implements INativeWnd.

Definition at line 934 of file SNativeWnd.cpp.

◆ GetHwnd()

HWND SNativeWnd::GetHwnd ( )

Retrieves the handle to the window.

Returns
HWND Handle to the window.

Implements INativeWnd.

Definition at line 237 of file SNativeWnd.cpp.

◆ GetID()

int SNativeWnd::GetID ( )
inline

Retrieves the window ID.

Returns
int Window ID.

Definition at line 155 of file SNativeWnd.h.

◆ GetMsgHandler()

MsgHandlerInfo * SNativeWnd::GetMsgHandler ( )

Retrieves the message handler for the window.

Returns
MsgHandlerInfo* Pointer to the message handler information.

Implements INativeWnd.

Definition at line 963 of file SNativeWnd.cpp.

◆ GetParent()

HWND SNativeWnd::GetParent ( )

Retrieves the handle to the parent window.

Returns
HWND Handle to the parent window.

Implements INativeWnd.

Definition at line 916 of file SNativeWnd.cpp.

◆ GetStyle()

DWORD SNativeWnd::GetStyle ( )

Retrieves the window style.

Returns
DWORD Window style.

Implements INativeWnd.

Definition at line 940 of file SNativeWnd.cpp.

◆ GetWindowDC()

HDC SNativeWnd::GetWindowDC ( )

Retrieves a device context for the entire window.

Returns
HDC Handle to the device context.

Implements INativeWnd.

Definition at line 799 of file SNativeWnd.cpp.

◆ GetWindowLongPtr()

LONG_PTR SNativeWnd::GetWindowLongPtr ( int nIndex)

Retrieves the long pointer value at the specified index.

Parameters
nIndexIndex of the value to retrieve.
Returns
LONG_PTR Long pointer value.

Implements INativeWnd.

Definition at line 928 of file SNativeWnd.cpp.

◆ GetWindowRect()

BOOL SNativeWnd::GetWindowRect ( LPRECT lpRect)

Retrieves the window rectangle.

Parameters
lpRectRectangle to receive the window rectangle.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 869 of file SNativeWnd.cpp.

◆ GetWindowText()

int SNativeWnd::GetWindowText ( LPTSTR lpszStringBuf,
int nMaxCount )

Retrieves the window text.

Parameters
lpszStringBufBuffer to receive the window text.
nMaxCountMaximum number of characters to copy to the buffer.
Returns
int Length of the string copied to the buffer, not including the terminating null character.

Implements INativeWnd.

Definition at line 723 of file SNativeWnd.cpp.

◆ HideCaret()

BOOL SNativeWnd::HideCaret ( )

Hides the caret.

Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 781 of file SNativeWnd.cpp.

◆ InitWndClass()

void SNativeWnd::InitWndClass ( HINSTANCE hInst,
LPCTSTR pszSimpleWndName,
BOOL bImeWnd )
static

Initializes the window class.

Parameters
hInstHandle to the application instance.
pszSimpleWndNameName of the simple window class.
bImeWndFlag indicating if the window uses IME.

Definition at line 214 of file SNativeWnd.cpp.

◆ Invalidate()

BOOL SNativeWnd::Invalidate ( BOOL bErase = TRUE)

Invalidates the entire window.

Parameters
bEraseFlag indicating if the background should be erased.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 881 of file SNativeWnd.cpp.

◆ InvalidateRect()

BOOL SNativeWnd::InvalidateRect ( LPCRECT lpRect,
BOOL bErase = TRUE )

Invalidates a specified rectangle of the window.

Parameters
lpRectRectangle to invalidate.
bEraseFlag indicating if the background should be erased.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 875 of file SNativeWnd.cpp.

◆ IsIconic()

BOOL SNativeWnd::IsIconic ( )

Checks if the window is iconic (minimized).

Returns
BOOL TRUE if the window is iconic, FALSE otherwise.

Implements INativeWnd.

Definition at line 717 of file SNativeWnd.cpp.

◆ IsWindow()

BOOL SNativeWnd::IsWindow ( )

Checks if the handle is a valid window handle.

Returns
BOOL TRUE if valid, FALSE otherwise.

Implements INativeWnd.

Definition at line 887 of file SNativeWnd.cpp.

◆ IsWindowEnabled()

BOOL SNativeWnd::IsWindowEnabled ( )

Checks if the window is enabled.

Returns
BOOL TRUE if the window is enabled, FALSE otherwise.

Implements INativeWnd.

Definition at line 904 of file SNativeWnd.cpp.

◆ IsWindowVisible()

BOOL SNativeWnd::IsWindowVisible ( )

Checks if the window is visible.

Returns
BOOL TRUE if the window is visible, FALSE otherwise.

Implements INativeWnd.

Definition at line 705 of file SNativeWnd.cpp.

◆ IsZoomed()

BOOL SNativeWnd::IsZoomed ( )

Checks if the window is zoomed (maximized).

Returns
BOOL TRUE if the window is zoomed, FALSE otherwise.

Implements INativeWnd.

Definition at line 711 of file SNativeWnd.cpp.

◆ KillTimer()

BOOL SNativeWnd::KillTimer ( UINT_PTR nIDEvent)

Kills a timer for the window.

Parameters
nIDEventTimer ID.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 811 of file SNativeWnd.cpp.

◆ MapWindowPoints()

int SNativeWnd::MapWindowPoints ( HWND hWndTo,
LPPOINT lpPoint,
UINT nCount )

Maps points from one window to another.

Parameters
hWndToHandle to the destination window.
lpPointPoints to map.
nCountNumber of points.
Returns
int Number of points mapped.

Implements INativeWnd.

Definition at line 829 of file SNativeWnd.cpp.

◆ MapWindowRect()

int SNativeWnd::MapWindowRect ( HWND hWndTo,
LPRECT lpRect )

Maps a rectangle from one window to another.

Parameters
hWndToHandle to the destination window.
lpRectRectangle to map.
Returns
int Number of points mapped.

Implements INativeWnd.

Definition at line 823 of file SNativeWnd.cpp.

◆ ModifyStyle()

BOOL SNativeWnd::ModifyStyle ( DWORD dwRemove,
DWORD dwAdd,
UINT nFlags = 0 )

Modifies the window style.

Parameters
dwRemoveStyles to remove.
dwAddStyles to add.
nFlagsFlags for modification.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 623 of file SNativeWnd.cpp.

◆ ModifyStyleEx()

BOOL SNativeWnd::ModifyStyleEx ( DWORD dwRemove,
DWORD dwAdd,
UINT nFlags = 0 )

Modifies the extended window style.

Parameters
dwRemoveStyles to remove.
dwAddStyles to add.
nFlagsFlags for modification.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 641 of file SNativeWnd.cpp.

◆ MoveWindow()

BOOL SNativeWnd::MoveWindow ( int x,
int y,
int nWidth,
int nHeight,
BOOL bRepaint = TRUE )

Moves the window to the specified position and resizes it.

Parameters
xX position of the window.
yY position of the window.
nWidthWidth of the window.
nHeightHeight of the window.
bRepaintFlag indicating if the window should be repainted.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 699 of file SNativeWnd.cpp.

◆ MoveWindow2()

BOOL SNativeWnd::MoveWindow2 ( LPCRECT lpRect,
BOOL bRepaint = TRUE )

Moves the window to the specified position and resizes it using a rectangle.

Parameters
lpRectRectangle defining the new position and size of the window.
bRepaintFlag indicating if the window should be repainted.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 693 of file SNativeWnd.cpp.

◆ OnFinalMessage()

void SNativeWnd::OnFinalMessage ( HWND hWnd)
protectedvirtual

Handles the final message for the window.

Parameters
hWndHandle to the window.

Reimplemented in SDropDownWnd, and STipCtrl.

Definition at line 242 of file SNativeWnd.cpp.

◆ PostMessage()

BOOL SNativeWnd::PostMessage ( UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0 )

Posts a message to the window.

Parameters
messageMessage to post.
wParamWPARAM for the message.
lParamLPARAM for the message.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 741 of file SNativeWnd.cpp.

◆ ProcessWindowMessage()

BOOL SNativeWnd::ProcessWindowMessage ( HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam,
LRESULT & lResult,
DWORD dwMsgMapID = 0 )
virtual

Processes a window message.

Parameters
hWndHandle to the window.
uMsgMessage identifier.
wParamWPARAM for the message.
lParamLPARAM for the message.
lResultResult of the message processing.
dwMsgMapIDMessage map ID.
Returns
BOOL TRUE if the message was handled, FALSE otherwise.

Reimplemented in SMessageBoxImpl.

Definition at line 660 of file SNativeWnd.cpp.

◆ ReflectNotifications()

LRESULT SNativeWnd::ReflectNotifications ( UINT uMsg,
WPARAM wParam,
LPARAM lParam,
BOOL & bHandled )

Reflects notifications to the appropriate handler.

Parameters
uMsgMessage identifier.
wParamWPARAM for the message.
lParamLPARAM for the message.
bHandledFlag indicating if the message was handled.
Returns
LRESULT Result of the message processing.

Definition at line 408 of file SNativeWnd.cpp.

◆ RegisterSimpleWnd()

ATOM SNativeWnd::RegisterSimpleWnd ( HINSTANCE hInst,
LPCTSTR pszSimpleWndName,
BOOL bImeWnd )
static

Registers a simple window class.

Parameters
hInstHandle to the application instance.
pszSimpleWndNameName of the simple window class.
bImeWndFlag indicating if the window uses IME.
Returns
ATOM Atom for the registered window class.

Definition at line 202 of file SNativeWnd.cpp.

◆ ReleaseCapture()

BOOL SNativeWnd::ReleaseCapture ( )

Releases the mouse capture.

Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 770 of file SNativeWnd.cpp.

◆ ReleaseDC()

int SNativeWnd::ReleaseDC ( HDC hDC)

Releases a device context.

Parameters
hDCHandle to the device context to release.
Returns
int Number of times the device context was released.

Implements INativeWnd.

Definition at line 793 of file SNativeWnd.cpp.

◆ ScreenToClient()

BOOL SNativeWnd::ScreenToClient ( LPPOINT lpPoint)

Converts screen coordinates to client coordinates.

Parameters
lpPointPoint to convert.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 843 of file SNativeWnd.cpp.

◆ ScreenToClient2()

BOOL SNativeWnd::ScreenToClient2 ( LPRECT lpRect)

Converts screen rectangle coordinates to client coordinates.

Parameters
lpRectRectangle to convert.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 835 of file SNativeWnd.cpp.

◆ SendMessage()

LRESULT SNativeWnd::SendMessage ( UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0 )

Sends a message to the window.

Parameters
messageMessage to send.
wParamWPARAM for the message.
lParamLPARAM for the message.
Returns
LRESULT Result of the message processing.

Implements INativeWnd.

Definition at line 747 of file SNativeWnd.cpp.

◆ SendNotifyMessage()

BOOL SNativeWnd::SendNotifyMessage ( UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0 )

Sends a notify message to the window.

Parameters
messageMessage to send.
wParamWPARAM for the message.
lParamLPARAM for the message.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 735 of file SNativeWnd.cpp.

◆ SetCapture()

HWND SNativeWnd::SetCapture ( )

Sets the window to capture the mouse.

Returns
HWND Handle to the previous capturing window.

Implements INativeWnd.

Definition at line 759 of file SNativeWnd.cpp.

◆ SetFocus()

HWND SNativeWnd::SetFocus ( )

Sets the input focus to the window.

Returns
HWND Handle to the previous focused window.

Implements INativeWnd.

Definition at line 753 of file SNativeWnd.cpp.

◆ SetID()

void SNativeWnd::SetID ( int nID)
inline

Sets the window ID.

Parameters
nIDNew window ID.

Definition at line 165 of file SNativeWnd.h.

◆ SetLayeredWindowAttributes()

BOOL SNativeWnd::SetLayeredWindowAttributes ( COLORREF crKey,
BYTE bAlpha,
DWORD dwFlags )

Sets the layered window attributes.

Parameters
crKeyColor key for transparency.
bAlphaAlpha value for transparency.
dwFlagsFlags for the layered window attributes.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 675 of file SNativeWnd.cpp.

◆ SetMsgHandler()

void SNativeWnd::SetMsgHandler ( FunMsgHandler fun,
void * ctx )

Sets the message handler for the window.

Parameters
funFunction pointer to the message handler.
ctxContext pointer for the message handler.

Implements INativeWnd.

Definition at line 957 of file SNativeWnd.cpp.

◆ SetParent()

HWND SNativeWnd::SetParent ( HWND hWndNewParent)

Sets the handle to the parent window.

Parameters
hWndNewParentHandle to the new parent window.
Returns
HWND Handle to the previous parent window.

Implements INativeWnd.

Definition at line 910 of file SNativeWnd.cpp.

◆ SetTimer()

UINT_PTR SNativeWnd::SetTimer ( UINT_PTR nIDEvent,
UINT nElapse,
void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD) = NULL )

Sets a timer for the window.

Parameters
nIDEventTimer ID.
nElapseElapse time in milliseconds.
lpfnTimerTimer callback function.
Returns
UINT_PTR Timer ID.

Implements INativeWnd.

Definition at line 817 of file SNativeWnd.cpp.

◆ SetWindowLongPtr()

LONG_PTR SNativeWnd::SetWindowLongPtr ( int nIndex,
LONG_PTR dwNewLong )

Sets the long pointer value at the specified index.

Parameters
nIndexIndex of the value to set.
dwNewLongNew long pointer value.
Returns
LONG_PTR Previous long pointer value.

Implements INativeWnd.

Definition at line 922 of file SNativeWnd.cpp.

◆ SetWindowPos()

BOOL SNativeWnd::SetWindowPos ( HWND hWndInsertAfter,
int x,
int y,
int cx,
int cy,
UINT nFlags )

Sets the window position.

Parameters
hWndInsertAfterHandle to the window to insert after.
xX position of the window.
yY position of the window.
cxWidth of the window.
cyHeight of the window.
nFlagsFlags for positioning.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 898 of file SNativeWnd.cpp.

◆ SetWindowRgn()

int SNativeWnd::SetWindowRgn ( HRGN hRgn,
BOOL bRedraw = TRUE )

Sets the window region.

Parameters
hRgnHandle to the region.
bRedrawFlag indicating if the window should be redrawn.
Returns
int Previous region handle.

Implements INativeWnd.

Definition at line 681 of file SNativeWnd.cpp.

◆ SetWindowText()

BOOL SNativeWnd::SetWindowText ( LPCTSTR lpszString)

Sets the window text.

Parameters
lpszStringString to set as the window text.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 729 of file SNativeWnd.cpp.

◆ ShowCaret()

BOOL SNativeWnd::ShowCaret ( )

Shows the caret.

Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 775 of file SNativeWnd.cpp.

◆ ShowWindow()

BOOL SNativeWnd::ShowWindow ( int nCmdShow)

Sets the show state of the window.

Parameters
nCmdShowCommand to show the window (e.g., SW_SHOW, SW_HIDE).
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 687 of file SNativeWnd.cpp.

◆ StartWindowProc()

LRESULT CALLBACK SNativeWnd::StartWindowProc ( HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam )
staticprotected

Start window procedure callback function (executed once).

Parameters
hWndHandle to the window.
uMsgMessage identifier.
wParamWPARAM for the message.
lParamLPARAM for the message.
Returns
LRESULT Result of the message processing.

Definition at line 310 of file SNativeWnd.cpp.

◆ SubclassWindow()

BOOL SNativeWnd::SubclassWindow ( HWND hWnd)

Subclasses an existing window.

Parameters
hWndHandle to the window to subclass.
Returns
BOOL TRUE–SUCCEEDED, FALSE–FAILED.

Implements INativeWnd.

Definition at line 330 of file SNativeWnd.cpp.

◆ UnsubclassWindow()

HWND SNativeWnd::UnsubclassWindow ( BOOL bForce = FALSE)

Unsubclasses a window.

Parameters
bForceFlag indicating if the unsubclassing should be forced.
Returns
HWND Handle to the unsubclassed window.

Implements INativeWnd.

Definition at line 356 of file SNativeWnd.cpp.

◆ UpdateLayeredWindow()

BOOL SNativeWnd::UpdateLayeredWindow ( HDC hdcDst,
POINT * pptDst,
SIZE * psize,
HDC hdcSrc,
POINT * pptSrc,
COLORREF crKey,
BLENDFUNCTION * pblend,
DWORD dwFlags )

Updates the layered window.

Parameters
hdcDstDestination device context.
pptDstDestination point.
psizeSize of the destination.
hdcSrcSource device context.
pptSrcSource point.
crKeyColor key for transparency.
pblendBlend function.
dwFlagsFlags for the update.
Returns
BOOL TRUE if successful, FALSE otherwise.

Implements INativeWnd.

Definition at line 665 of file SNativeWnd.cpp.

◆ WindowProc()

LRESULT CALLBACK SNativeWnd::WindowProc ( HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam )
staticprotected

Window procedure callback function.

Parameters
hWndHandle to the window.
uMsgMessage identifier.
wParamWPARAM for the message.
lParamLPARAM for the message.
Returns
LRESULT Result of the message processing.

Definition at line 254 of file SNativeWnd.cpp.

Member Data Documentation

◆ m_bDestoryed

BOOL SNativeWnd::m_bDestoryed
protected

Flag indicating if the window is destroyed.

Definition at line 740 of file SNativeWnd.h.

◆ m_hWnd

HWND SNativeWnd::m_hWnd

Handle to the window.

Definition at line 744 of file SNativeWnd.h.

◆ m_msgHandlerInfo

MsgHandlerInfo SNativeWnd::m_msgHandlerInfo
protected

Message handler information.

Definition at line 741 of file SNativeWnd.h.

◆ m_pCurrentMsg

const MSG* SNativeWnd::m_pCurrentMsg
protected

Pointer to the current message.

Definition at line 739 of file SNativeWnd.h.

◆ m_pfnSuperWindowProc

WNDPROC SNativeWnd::m_pfnSuperWindowProc
protected

Pointer to the superclass window procedure.

Definition at line 769 of file SNativeWnd.h.

◆ m_pThunk

tagThunk* SNativeWnd::m_pThunk
protected

Thunk structure.

Definition at line 768 of file SNativeWnd.h.


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