| title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CWindow Class |
11/04/2016 |
|
|
fefa00c8-f053-4bcf-87bc-dc84f5386683 |
This class provides methods for manipulating a window.
Important
This class and its members cannot be used in applications that execute in the Windows Runtime.
class CWindow
| Name | Description |
|---|---|
| CWindow::CWindow | Constructor. |
| Name | Description |
|---|---|
| CWindow::ArrangeIconicWindows | Arranges all minimized child windows. |
| CWindow::Attach | Attaches a window to the CWindow object. |
| CWindow::BeginPaint | Prepares the window for painting. |
| CWindow::BringWindowToTop | Brings the window to the top of the Z order. |
| CWindow::CenterWindow | Centers the window against a given window. |
| CWindow::ChangeClipboardChain | Removes the window from the chain of Clipboard viewers. |
| CWindow::CheckDlgButton | Changes the check state of the specified button. |
| CWindow::CheckRadioButton | Checks the specified radio button. |
| CWindow::ChildWindowFromPoint | Retrieves the child window containing the specified point. |
| CWindow::ChildWindowFromPointEx | Retrieves a particular type of child window containing the specified point. |
| CWindow::ClientToScreen | Converts client coordinates to screen coordinates. |
| CWindow::Create | Creates a window. |
| CWindow::CreateCaret | Creates a new shape for the system caret. |
| CWindow::CreateGrayCaret | Creates a gray rectangle for the system caret. |
| CWindow::CreateSolidCaret | Creates a solid rectangle for the system caret. |
| CWindow::DeferWindowPos | Updates the specified multiple-window-position structure for the specified window. |
| CWindow::DestroyWindow | Destroys the window associated with the CWindow object. |
| CWindow::Detach | Detaches the window from the CWindow object. |
| CWindow::DlgDirList | Fills a list box with the names of all files matching a specified path or file name. |
| CWindow::DlgDirListComboBox | Fills a combo box with the names of all files matching a specified path or file name. |
| CWindow::DlgDirSelect | Retrieves the current selection from a list box. |
| CWindow::DlgDirSelectComboBox | Retrieves the current selection from a combo box. |
| CWindow::DragAcceptFiles | Registers whether the window accepts dragged files. |
| CWindow::DrawMenuBar | Redraws the window's menu bar. |
| CWindow::EnableScrollBar | Enables or disables the scroll bar arrows. |
| CWindow::EnableWindow | Enables or disables input. |
| CWindow::EndPaint | Marks the end of painting. |
| CWindow::FlashWindow | Flashes the window once. |
| CWindow::GetClientRect | Retrieves the coordinates of the client area. |
| CWindow::GetDC | Retrieves a device context for the client area. |
| CWindow::GetDCEx | Retrieves a device context for the client area and allows clipping options. |
| CWindow::GetDescendantWindow | Retrieves the specified descendant window. |
| CWindow::GetDlgControl | Retrieves an interface on the specified control. |
| CWindow::GetDlgCtrlID | Retrieves the window's identifier (for child windows only). |
| CWindow::GetDlgHost | Retrieves a pointer to an interface to the ATL Control hosting container. |
| CWindow::GetDlgItem | Retrieves the specified child window. |
| CWindow::GetDlgItemInt | Translates a control's text to an integer. |
| CWindow::GetDlgItemText | Retrieves a control's text. |
| CWindow::GetExStyle | Retrieves the extended window styles. |
| CWindow::GetFont | Retrieves the window's current font. |
| CWindow::GetHotKey | Determines the hot key associated with the window. |
| CWindow::GetIcon | Retrieves the window's large or small icon. |
| CWindow::GetLastActivePopup | Retrieves the most recently active pop-up window. |
| CWindow::GetMenu | Retrieves the window's menu. |
| CWindow::GetNextDlgGroupItem | Retrieves the previous or next control within a group of controls. |
| CWindow::GetNextDlgTabItem | Retrieves the previous or next control having the WS_TABSTOP style. |
| CWindow::GetParent | Retrieves the immediate parent window. |
| CWindow::GetScrollInfo | Retrieves the parameters of a scroll bar. |
| CWindow::GetScrollPos | Retrieves the position of the scroll box. |
| CWindow::GetScrollRange | Retrieves the scroll bar range. |
| CWindow::GetStyle | Retrieves the window styles. |
| CWindow::GetSystemMenu | Creates a copy of the system menu for modification. |
| CWindow::GetTopLevelParent | Retrieves the top-level parent or owner window. |
| CWindow::GetTopLevelWindow | Retrieves the top-level owner window. |
| CWindow::GetTopWindow | Retrieves the top-level child window. |
| CWindow::GetUpdateRect | Retrieves the coordinates of the smallest rectangle that completely encloses the update region. |
| CWindow::GetUpdateRgn | Retrieves the update region and copies it into a specified region. |
| CWindow::GetWindow | Retrieves the specified window. |
| CWindow::GetWindowContextHelpId | Retrieves the window's help context identifier. |
| CWindow::GetWindowDC | Retrieves a device context for the entire window. |
| CWindow::GetWindowLong | Retrieves a 32-bit value at a specified offset into the extra window memory. |
| CWindow::GetWindowLongPtr | Retrieves information about the specified window, including a value at a specified offset into the extra window memory. |
| CWindow::GetWindowPlacement | Retrieves the show state and positions. |
| CWindow::GetWindowProcessID | Retrieves the identifier of the process that created the window. |
| CWindow::GetWindowRect | Retrieves the window's bounding dimensions. |
| CWindow::GetWindowRgn | Obtains a copy of the window region of a window. |
| CWindow::GetWindowText | Retrieves the window's text. |
| CWindow::GetWindowTextLength | Retrieves the length of the window's text. |
| CWindow::GetWindowThreadID | Retrieves the identifier of the thread that created the specified window. |
| CWindow::GetWindowWord | Retrieves a 16-bit value at a specified offset into the extra window memory. |
| CWindow::GotoDlgCtrl | Sets the keyboard focus to a control in the dialog box. |
| CWindow::HideCaret | Hides the system caret. |
| CWindow::HiliteMenuItem | Highlights or removes the highlight from a top-level menu item. |
| CWindow::Invalidate | Invalidates the entire client area. |
| CWindow::InvalidateRect | Invalidates the client area within the specified rectangle. |
| CWindow::InvalidateRgn | Invalidates the client area within the specified region. |
| CWindow::IsChild | Determines whether the specified window is a child window. |
| CWindow::IsDialogMessage | Determines whether a message is intended for the specified dialog box. |
| CWindow::IsDlgButtonChecked | Determines the check state of the button. |
| CWindow::IsIconic | Determines whether the window is minimized. |
| CWindow::IsParentDialog | Determines if the parent window of a control is a dialog window. |
| CWindow::IsWindow | Determines whether the specified window handle identifies an existing window. |
| CWindow::IsWindowEnabled | Determines whether the window is enabled for input. |
| CWindow::IsWindowUnicode | Determines whether the specified window is a native Unicode window. |
| CWindow::IsWindowVisible | Determines the window's visibility state. |
| CWindow::IsZoomed | Determines whether the window is maximized. |
| CWindow::KillTimer | Destroys a timer event. |
| CWindow::LockWindowUpdate | Disables or enables drawing in the window. |
| CWindow::MapWindowPoints | Converts a set of points from the window's coordinate space to the coordinate space of another window. |
| CWindow::MessageBox | Displays a message box. |
| CWindow::ModifyStyle | Modifies the window styles. |
| CWindow::ModifyStyleEx | Modifies the extended window styles. |
| CWindow::MoveWindow | Changes the window's size and position. |
| CWindow::NextDlgCtrl | Sets the keyboard focus to the next control in the dialog box. |
| CWindow::OpenClipboard | Opens the Clipboard. |
| CWindow::PostMessage | Places a message in the message queue associated with the thread that created the window. Returns without waiting for the thread to process the message. |
| CWindow::PrevDlgCtrl | Sets the keyboard focus to the previous control in the dialog box. |
| CWindow::Print | Requests that the window be drawn in a specified device context. |
| CWindow::PrintClient | Requests that the window's client area be drawn in a specified device context. |
| CWindow::RedrawWindow | Updates a specified rectangle or region in the client area. |
| CWindow::ReleaseDC | Releases a device context. |
| CWindow::ResizeClient | Resizes the window. |
| CWindow::ScreenToClient | Converts screen coordinates to client coordinates. |
| CWindow::ScrollWindow | Scrolls the specified client area. |
| CWindow::ScrollWindowEx | Scrolls the specified client area with additional features. |
| CWindow::SendDlgItemMessage | Sends a message to a control. |
| CWindow::SendMessage | Sends a message to the window and does not return until the window procedure has processed the message. |
| CWindow::SendMessageToDescendants | Sends a message to the specified descendant windows. |
| CWindow::SendNotifyMessage | Sends a message to the window. If the window was created by the calling thread, SendNotifyMessage does not return until the window procedure has processed the message. Otherwise, it returns immediately. |
| CWindow::SetActiveWindow | Activates the window. |
| CWindow::SetCapture | Sends all subsequent mouse input to the window. |
| CWindow::SetClipboardViewer | Adds the window to the Clipboard viewer chain. |
| CWindow::SetDlgCtrlID | Changes the window's identifier. |
| CWindow::SetDlgItemInt | Changes a control's text to the string representation of an integer value. |
| CWindow::SetDlgItemText | Changes a control's text. |
| CWindow::SetFocus | Sets the input focus to the window. |
| CWindow::SetFont | Changes the window's current font. |
| CWindow::SetHotKey | Associates a hot key with the window. |
| CWindow::SetIcon | Changes the window's large or small icon. |
| CWindow::SetMenu | Changes the window's current menu. |
| CWindow::SetParent | Changes the parent window. |
| CWindow::SetRedraw | Sets or clears the redraw flag. |
| CWindow::SetScrollInfo | Sets the parameters of a scroll bar. |
| CWindow::SetScrollPos | Changes the position of the scroll box. |
| CWindow::SetScrollRange | Changes the scroll bar range. |
| CWindow::SetTimer | Creates a timer event. |
| CWindow::SetWindowContextHelpId | Sets the window's help context identifier. |
| CWindow::SetWindowLong | Sets a 32-bit value at a specified offset into the extra window memory. |
| CWindow::SetWindowLongPtr | Changes an attribute of the specified window, and also sets a value at the specified offset in the extra window memory. |
| CWindow::SetWindowPlacement | Sets the show state and positions. |
| CWindow::SetWindowPos | Sets the size, position, and Z order. |
| CWindow::SetWindowRgn | Sets the window region of a window. |
| CWindow::SetWindowText | Changes the window's text. |
| CWindow::SetWindowWord | Sets a 16-bit value at a specified offset into the extra window memory. |
| CWindow::ShowCaret | Displays the system caret. |
| CWindow::ShowOwnedPopups | Shows or hides the pop-up windows owned by the window. |
| CWindow::ShowScrollBar | Shows or hides a scroll bar. |
| CWindow::ShowWindow | Sets the window's show state. |
| CWindow::ShowWindowAsync | Sets the show state of a window created by a different thread. |
| CWindow::UpdateWindow | Updates the client area. |
| CWindow::ValidateRect | Validates the client area within the specified rectangle. |
| CWindow::ValidateRgn | Validates the client area within the specified region. |
| CWindow::WinHelp | Starts Windows Help. |
| Name | Description |
|---|---|
| CWindow::operator HWND | Converts the CWindow object to an HWND. |
| CWindow::operator = | Assigns an HWND to the CWindow object. |
| Name | Description |
|---|---|
| CWindow::m_hWnd | The handle to the window associated with the CWindow object. |
| CWindow::rcDefault | Contains default window dimensions. |
CWindow provides the base functionality for manipulating a window in ATL. Many of the CWindow methods simply wrap one of the Win32 API functions. For example, compare the prototypes for CWindow::ShowWindow and ShowWindow:
| CWindow method | Win32 function |
|---|---|
BOOL ShowWindow( int nCmdShow ); |
BOOL ShowWindow( HWND hWnd , int nCmdShow ); |
CWindow::ShowWindow calls the Win32 function ShowWindow by passing CWindow::m_hWnd as the first parameter. Every CWindow method that directly wraps a Win32 function passes the m_hWnd member; therefore, much of the CWindow documentation will refer you to the Windows SDK.
Note
Not every window-related Win32 function is wrapped by CWindow, and not every CWindow method wraps a Win32 function.
CWindow::m_hWnd stores the HWND that identifies a window. An HWND is attached to your object when you:
-
Specify an HWND in
CWindow's constructor. -
Call
CWindow::Attach. -
Use
CWindow's operator =. -
Create or subclass a window using one of the following classes derived from
CWindow:
CWindowImpl Allows you to create a new window or subclass an existing window.
CContainedWindow Implements a window contained within another object. You can create a new window or subclass an existing window.
CDialogImpl Allows you to create a modal or modeless dialog box.
For more information about windows, see Windows and subsequent topics in the Windows SDK. For more information about using windows in ATL, see the article ATL Window Classes.
Header: atlwin.h
Arranges all minimized child windows.
UINT ArrangeIconicWindows() throw();
See ArrangeIconicWindows in the Windows SDK.
Attaches the window identified by hWndNew to the CWindow object.
void Attach(HWND hWndNew) throw();
hWndNew
[in] The handle to a window.
[!code-cppNVC_ATL_Windowing#1]
Prepares the window for painting.
HDC BeginPaint(LPPAINTSTRUCT lpPaint) throw();
See BeginPaint in the Windows SDK.
[!code-cppNVC_ATL_Windowing#2]
Brings the window to the top of the Z order.
BOOL BringWindowToTop() throw();
See BringWindowToTop in the Windows SDK.
[!code-cppNVC_ATL_Windowing#3]
Centers the window against a given window.
BOOL CenterWindow(HWND hWndCenter = NULL) throw();
hWndCenter
[in] The handle to the window against which to center. If this parameter is NULL (the default value), the method will set hWndCenter to the window's parent window if it is a child window. Otherwise, it will set hWndCenter to the window's owner window.
TRUE if the window is successfully centered; otherwise, FALSE.
[!code-cppNVC_ATL_Windowing#4]
Removes the window from the chain of Clipboard viewers.
BOOL ChangeClipboardChain(HWND hWndNewNext) throw();
See ChangeClipboardChain in the Windows SDK.
Changes the check state of the specified button.
BOOL CheckDlgButton(int nIDButton, UINT nCheck) throw();
See CheckDlgButton in the Windows SDK.
Checks the specified radio button.
BOOL CheckRadioButton(
int nIDFirstButton,
int nIDLastButton,
int nIDCheckButton) throw();
See CheckRadioButton in the Windows SDK.
Retrieves the child window containing the specified point.
HWND ChildWindowFromPoint(POINT point) const throw();
See ChildWindowFromPoint in the Windows SDK.
Retrieves a particular type of child window containing the specified point.
HWND ChildWindowFromPoint(POINT point, UINT uFlags) const throw();
See ChildWindowFromPointEx in the Windows SDK.
Converts client coordinates to screen coordinates.
BOOL ClientToScreen(LPPOINT lpPoint) const throw();
BOOL ClientToScreen(LPRECT lpRect) const throw();
See ClientToScreen in the Windows SDK.
The second version of this method allows you to convert the coordinates of a RECT structure.
Creates a window.
HWND Create(
LPCTSTR lpstrWndClass,
HWND hWndParent,
_U_RECT rect = NULL,
LPCTSTR szWindowName = NULL,
DWORD dwStyle = 0,
DWORD dwExStyle = 0,
_U_MENUorID MenuOrID = 0U,
LPVOID lpCreateParam = NULL) throw();
lpstrWndClass
[in] A pointer to the window's class.
hWndParent
[in] The handle to the parent or owner window.
rect
[in] A variable of type _U_RECT specifying the position of the window. The default value is NULL. When this parameter is NULL, the value of CWindow::rcDefault is used.
szWindowName
[in] Specifies the name of the window. The default value is NULL.
dwStyle
[in] The style of the window. The default value is 0, meaning no style is specified. For a list of possible values, see CreateWindow in the Windows SDK.
dwExStyle
[in] The extended window style. The default value is 0, meaning no extended style is specified. For a list of possible values, see CreateWindowEx in the Windows SDK.
MenuOrID
[in] A variable of type _U_MENUorID specifying a handle to a menu or a window identifier. The default value is 0U.
lpCreateParam
A pointer to the window-creation data contained in a CREATESTRUCT structure.
If successful, the handle to the newly created window, specified by m_hWnd. Otherwise, NULL.
CWindow::rcDefault is defined as __declspec(selectany) RECT CWindow::rcDefault = {CW_USEDEFAULT, CW_USEDEFAULT, 0, 0};.
See CreateWindow in the Windows SDK for more information.
Note If 0 is used as the value for the MenuOrID parameter, it must be specified as 0U (the default value) to avoid a compiler error.
Creates a new shape for the system caret.
BOOL CreateCaret(HBITMAP pBitmap) throw();
See CreateCaret in the Windows SDK.
Creates a gray rectangle for the system caret.
BOOL CreateGrayCaret(int nWidth, int nHeight) throw();
See CreateCaret in the Windows SDK.
Passes (HBITMAP) 1 for the bitmap handle parameter to the Win32 function.
Creates a solid rectangle for the system caret.
BOOL CreateSolidCaret(int nWidth, int nHeight) throw();
See CreateCaret in the Windows SDK.
Passes (HBITMAP) 0 for the bitmap handle parameter to the Win32 function.
The constructor.
CWindow(HWND hWnd = NULL) throw();
hWnd
[in] The handle to a window.
Initializes the m_hWnd member to hWnd, which by default is NULL.
Note
CWindow::CWindow does not create a window. Classes CWindowImpl, CContainedWindow, and CDialogImpl (all of which derive from CWindow) provide a method to create a window or dialog box, which is then assigned to CWindow::m_hWnd. You can also use the CreateWindow Win32 function.
Updates the specified multiple-window-position structure for the specified window.
HDWP DeferWindowPos(
HDWP hWinPosInfo,
HWND hWndInsertAfter,
int x,
int y,
int cx,
int cy,
UINT uFlags) throw();
See DeferWindowPos in the Windows SDK.
Destroys the window associated with the CWindow object and sets m_hWnd to NULL.
BOOL DestroyWindow() throw();
See DestroyWindow in the Windows SDK.
It does not destroy the CWindow object itself.
[!code-cppNVC_ATL_Windowing#5]
Detaches m_hWnd from the CWindow object and sets m_hWnd to NULL.
HWND Detach() throw();
The HWND associated with the CWindow object.
[!code-cppNVC_ATL_Windowing#6]
Fills a list box with the names of all files matching a specified path or file name.
int DlgDirList(
LPTSTR lpPathSpec,
int nIDListBox,
int nIDStaticPath,
UINT nFileType) throw();
See DlgDirList in the Windows SDK.
Fills a combo box with the names of all files matching a specified path or file name.
int DlgDirListComboBox(
LPTSTR lpPathSpec,
int nIDComboBox,
int nIDStaticPath,
UINT nFileType) throw();
See DlgDirListComboBox in the Windows SDK.
Retrieves the current selection from a list box.
BOOL DlgDirSelect(
LPTSTR lpString,
int nCount,
int nIDListBox) throw();
See DlgDirSelectEx in the Windows SDK.
Retrieves the current selection from a combo box.
BOOL DlgDirSelectComboBox(
LPTSTR lpString,
int nCount,
int nIDComboBox) throw();
See DlgDirSelectComboBoxEx in the Windows SDK.
Registers whether the window accepts dragged files.
void DragAcceptFiles(BOOL bAccept = TRUE);
See DragAcceptFiles in the Windows SDK.
Redraws the window's menu bar.
BOOL DrawMenuBar() throw();
See DrawMenuBar in the Windows SDK.
Enables or disables the scroll bar arrows.
BOOL EnableScrollBar(UINT uSBFlags, UINT uArrowFlags = ESB_ENABLE_BOTH) throw();
See EnableScrollBar in the Windows SDK.
Enables or disables input.
BOOL EnableWindow(BOOL bEnable = TRUE) throw();
See EnableWindow in the Windows SDK.
[!code-cppNVC_ATL_Windowing#7]
Marks the end of painting.
void EndPaint(LPPAINTSTRUCT lpPaint) throw();
See EndPaint in the Windows SDK.
[!code-cppNVC_ATL_Windowing#2]
Flashes the window once.
BOOL FlashWindow(BOOL bInvert) throw();
See FlashWindow in the Windows SDK.
Retrieves the coordinates of the client area.
BOOL GetClientRect(LPRECT lpRect) const throw();
See GetClientRect in the Windows SDK.
[!code-cppNVC_ATL_Windowing#8]
Retrieves a device context for the client area.
HDC GetDC() throw();
See GetDC in the Windows SDK.
[!code-cppNVC_ATL_Windowing#9]
Retrieves a device context for the client area and allows clipping options.
HDC GetDCEx(HRGN hRgnClip, DWORD flags) throw();
See GetDCEx in the Windows SDK.
Finds the descendant window specified by the given identifier.
HWND GetDescendantWindow(int nID) const throw();
nID
[in] The identifier of the descendant window to be retrieved.
The handle to a descendant window.
GetDescendantWindow searches the entire tree of child windows, not only the windows that are immediate children.
Call this function to get a pointer to an interface of an ActiveX control that is hosted by a composite control or a control-hosting dialog.
HRESULT GetDlgControl(
int nID,
REFIID iid,
void** ppCtrl) throw();
nID
[in] The resource ID of the control being retrieved.
iid
[in] The ID of the interface you would like to get from the control.
ppCtrl
[out] The pointer to the interface.
Returns S_OK on success or any valid error HRESULT. For example, the function returns E_FAIL if the control specified by nID cannot be found and it returns E_NOINTERFACE if the control can be found, but it doesn't support the interface specified by iid.
Using this pointer, you can call methods on the interface.
Retrieves the window's identifier (for child windows only).
int GetDlgCtrlID() const throw();
See GetDlgCtrlID in the Windows SDK.
Retrieves a pointer to an interface to the ATL Control hosting container.
HRESULT GetDlgHost(
int nID,
REFIID iid,
void** ppHost) throw();
nID
[in] The resource ID of the control being retrieved.
iid
[in] The ID of the interface you would like to get from the control.
ppHost
[out] The pointer to the interface.
Returns S_OK if the window specified by iid is a Control Container, and the requested interface could be retrieved. Returns E_FAIL if the window is not a Control Container, or if the interface requested could not be retrieved. If a window with the specified ID could not be found, then the return value is equal to HRESULT_FROM_WIN32(ERROR_CONTROL_ID_NOT_FOUND).
Using this pointer, you can call methods on the interface.
Retrieves the specified child window.
HWND GetDlgItem(int nID) const throw();
See GetDlgItem in the Windows SDK.
Translates a control's text to an integer.
UINT GetDlgItemInt(
int nID,
BOOL* lpTrans = NULL,
BOOL bSigned = TRUE) const throw();
See GetDlgItemInt in the Windows SDK.
Retrieves a control's text.
UINT GetDlgItemText(
int nID,
LPTSTR lpStr,
int nMaxCount) const throw();
BOOL GetDlgItemText(
int nID,
BSTR& bstrText) const throw();
See GetDlgItemText in the Windows SDK.
The second version of this method allows you to copy the control's text to a BSTR. This version returns TRUE if the text is successfully copied; otherwise, FALSE.
Retrieves the extended window styles of the window.
DWORD GetExStyle() const throw();
The window's extended styles.
To retrieve the regular window styles, call GetStyle.
[!code-cppNVC_ATL_Windowing#10]
Retrieves the window's current font by sending a WM_GETFONT message to the window.
HFONT GetFont() const throw();
A font handle.
Determines the hot key associated with the window by sending a WM_GETHOTKEY message.
DWORD GetHotKey() const throw();
The virtual key code and modifiers for the hot key associated with the window. For a list of possible modifiers, see WM_GETHOTKEY in the Windows SDK. For a list of standard virtual key codes, see Winuser.h.
Retrieves the handle to the window's large or small icon.
HICON GetIcon(BOOL bBigIcon = TRUE) const;
bBigIcon
[in] If TRUE (the default value) the method returns the large icon. Otherwise, it returns the small icon.
An icon handle.
GetIcon sends a WM_GETICON message to the window.
Retrieves the most recently active pop-up window.
HWND GetLastActivePopup() const throw();
See GetLastActivePopup in the Windows SDK.
Retrieves the window's menu.
HMENU GetMenu() const throw();
See GetMenu in the Windows SDK.
Retrieves the previous or next control within a group of controls.
HWND GetNextDlgGroupItem(HWND hWndCtl, BOOL bPrevious = FALSE) const throw();
See GetNextDlgGroupItem in the Windows SDK.
Retrieves the previous or next control having the WS_TABSTOP style.
HWND GetNextDlgTabItem(HWND hWndCtl, BOOL bPrevious = FALSE) const throw();
See GetNextDlgTabItem in the Windows SDK.
Retrieves the immediate parent window.
HWND GetParent() const throw();
See GetParent in the Windows SDK.
[!code-cppNVC_ATL_Windowing#11]
Retrieves the parameters of a scroll bar.
BOOL GetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo) throw();
See GetScrollInfo in the Windows SDK.
Retrieves the position of the scroll box.
int GetScrollPos(int nBar) const throw();
See GetScrollPos in the Windows SDK.
Retrieves the scroll bar range.
BOOL GetScrollRange(
int nBar,
LPINT lpMinPos,
LPINT lpMaxPos) const throw();
See GetScrollRange in the Windows SDK.
Retrieves the window styles of the window.
DWORD GetStyle() const throw();
The window's styles.
To retrieve the extended window styles, call GetExStyle.
[!code-cppNVC_ATL_Windowing#12]
Creates a copy of the system menu for modification.
HMENU GetSystemMenu(BOOL bRevert) const throw();
See GetSystemMenu in the Windows SDK.
Retrieves the window's top-level parent window.
HWND GetTopLevelParent() const throw();
The handle to the top-level parent window.
Retrieves the window's top-level parent or owner window.
HWND GetTopLevelWindow() const throw();
The handle to the top-level owner window.
Retrieves the top-level child window.
HWND GetTopWindow() const throw();
See GetTopWindow in the Windows SDK.
[!code-cppNVC_ATL_Windowing#13]
Retrieves the coordinates of the smallest rectangle that completely encloses the update region.
BOOL GetUpdateRect(LPRECT lpRect, BOOL bErase = FALSE) throw();
See GetUpdateRect in the Windows SDK.
Retrieves the update region and copies it into a specified region.
int GetUpdateRgn(HRGN hRgn, BOOL bErase = FALSE) throw();
See GetUpdateRgn in the Windows SDK.
Retrieves the specified window.
HWND GetWindow(UINT nCmd) const throw();
See GetWindow in the Windows SDK.
Retrieves the window's help context identifier.
DWORD GetWindowContextHelpId() const throw();
See GetWindowContextHelpId in the Windows SDK.
Retrieves a device context for the entire window.
HDC GetWindowDC() throw();
See GetWindowDC in the Windows SDK.
[!code-cppNVC_ATL_Windowing#14]
Retrieves a 32-bit value at a specified offset into the extra window memory.
LONG GetWindowLong(int nIndex) const throw();
See GetWindowLong in the Windows SDK.
Note
To write code that is compatible with both 32-bit and 64-bit versions of Windows, use CWindow::GetWindowLongPtr.
Retrieves information about the specified window, including a value at a specified offset into the extra window memory.
LONG_PTR GetWindowLongPtr(int nIndex) const throw();
See GetWindowLongPtr in the Windows SDK.
If you are retrieving a pointer or a handle, this function supersedes the CWindow::GetWindowLong method.
Note
Pointers and handles are 32 bits on 32-bit Windows and 64 bits on 64-bit Windows.
To write code that is compatible with both 32-bit and 64-bit versions of Windows, use CWindow::GetWindowLongPtr.
Retrieves the show state and positions.
BOOL GetWindowPlacement(WINDOWPLACEMENT FAR* lpwndpl) const throw();
See GetWindowPlacement in the Windows SDK.
Retrieves the identifier of the process that created the window.
DWORD GetWindowProcessID() throw();
See GetWindowThreadProcessID in the Windows SDK.
[!code-cppNVC_ATL_Windowing#15]
Retrieves the window's bounding dimensions.
BOOL GetWindowRect(LPRECT lpRect) const throw();
See GetWindowRect in the Windows SDK.
Obtains a copy of the window region of a window.
int GetWindowRgn(HRGN hRgn) throw();
See GetWindowRgn in the Windows SDK.
Retrieves the window's text.
int GetWindowText(LPTSTR lpszStringBuf, int nMaxCount) const throw();
BOOL GetWindowText(BSTR& bstrText) throw();
int GetWindowText(CSimpleString& strText) const;
lpszStringBuf
A buffer to which to write the window text.
nMaxCount
The size of the buffer in characters; also the maximum number of characters to write.
bstrText
A BSTR in which to store the window text.
strText
A CString in which to store the window text.
If the text is successfully copied, the return value is TRUE; otherwise, the return value is FALSE.
See GetWindowText in the Windows SDK.
The second version of this method allows you to store the text in a BSTR; the third version allows you to store the result in a CString, since CSimpleString is the base class of CString.
Retrieves the length of the window's text.
int GetWindowTextLength() const throw();
See GetWindowTextLength in the Windows SDK.
Retrieves the identifier of the thread that created the specified window.
DWORD GetWindowThreadID() throw();
See GetWindowThreadProcessID in the Windows SDK.
[!code-cppNVC_ATL_Windowing#16]
Retrieves a 16-bit value at a specified offset into the extra window memory.
WORD GetWindowWord(int nIndex) const throw();
See GetWindowLong in the Windows SDK.
Sets the keyboard focus to a control in the dialog box.
void GotoDlgCtrl(HWND hWndCtrl) const throw();
See WM_NEXTDLGCTL in the Windows SDK.
Hides the system caret.
BOOL HideCaret() throw();
See HideCaret in the Windows SDK.
[!code-cppNVC_ATL_Windowing#17]
Highlights or removes the highlight from a top-level menu item.
BOOL HiliteMenuItem(
HMENU hMenu,
UINT uHiliteItem,
UINT uHilite) throw();
See HiliteMenuItem in the Windows SDK.
Invalidates the entire client area.
BOOL Invalidate(BOOL bErase = TRUE) throw();
See InvalidateRect in the Windows SDK.
Passes NULL for the RECT parameter to the InvalidateRect Win32 function.
[!code-cppNVC_ATL_Windowing#18]
Invalidates the client area within the specified rectangle.
BOOL InvalidateRect(LPCRECT lpRect, BOOL bErase = TRUE) throw();
See InvalidateRect in the Windows SDK.
Invalidates the client area within the specified region.
void InvalidateRgn(HRGN hRgn, BOOL bErase = TRUE) throw();
See InvalidateRgn in the Windows SDK.
Specifies a void return type, while the InvalidateRgn Win32 function always returns TRUE.
Determines whether the specified window is a child window.
BOOL IsChild(const HWND hWnd) const throw();
See IsChild in the Windows SDK.
Determines whether a message is intended for the specified dialog box.
BOOL IsDialogMessage(LPMSG lpMsg) throw();
See IsDialogMessage in the Windows SDK.
Determines the check state of the button.
UINT IsDlgButtonChecked(int nIDButton) const throw();
See IsDlgButtonChecked in the Windows SDK.
Determines whether the window is minimized.
BOOL IsIconic() const throw();
See IsIconic in the Windows SDK.
[!code-cppNVC_ATL_Windowing#19]
Determines if the parent window of the control is a dialog window.
BOOL IsParentDialog() throw();
Returns TRUE if the parent window is a dialog, FALSE otherwise.
Determines whether the specified window handle identifies an existing window.
BOOL IsWindow() throw();
See IsWindow in the Windows SDK.
[!code-cppNVC_ATL_Windowing#20]
Determines whether the window is enabled for input.
BOOL IsWindowEnabled() const throw();
See IsWindowEnabled in the Windows SDK.
[!code-cppNVC_ATL_Windowing#21]
Determines the window's visibility state.
BOOL IsWindowVisible() const throw();
See IsWindowVisible in the Windows SDK.
[!code-cppNVC_ATL_Windowing#22]
Determines whether the specified window is a native Unicode window.
BOOL IsWindowUnicode() throw();
See IsWindowUnicode in the Windows SDK.
[!code-cppNVC_ATL_Windowing#23]
Determines whether the window is maximized.
BOOL IsZoomed() const throw();
See IsZoomed in the Windows SDK.
Destroys a timer event created by CWindow::SetTimer.
BOOL KillTimer(UINT nIDEvent) throw();
See KillTimer in the Windows SDK.
Disables or enables drawing in the window by calling the LockWindowUpdate Win32 function.
BOOL LockWindowUpdate(BOOL bLock = TRUE) throw();
bLock
[in] If TRUE (the default value), the window will be locked. Otherwise, it will be unlocked.
TRUE if the window is successfully locked; otherwise, FALSE.
If bLock is TRUE, this method passes m_hWnd to the Win32 function; otherwise, it passes NULL.
Contains a handle to the window associated with the CWindow object.
HWND m_hWnd throw() throw();
Converts a set of points from the window's coordinate space to the coordinate space of another window.
int MapWindowPoints(
HWND hWndTo,
LPPOINT lpPoint,
UINT nCount) const throw();
int MapWindowPoints(
HWND hWndTo,
LPRECT lpRect) const throw();
See MapWindowPoints in the Windows SDK.
The second version of this method allows you to convert the coordinates of a RECT structure.
Displays a message box.
int MessageBox(
LPCTSTR lpszText,
LPCTSTR lpszCaption = NULL,
UINT nType = MB_OK) throw();
See MessageBox in the Windows SDK.
[!code-cppNVC_ATL_Windowing#24]
Modifies the window styles of the CWindow object.
BOOL ModifyStyle(
DWORD dwRemove,
DWORD dwAdd,
UINT nFlags = 0) throw();
dwRemove
[in] Specifies the window styles to be removed during style modification.
dwAdd
[in] Specifies the window styles to be added during style modification.
nFlags
[in] Window-positioning flags. For a list of possible values, see the SetWindowPos function in the Windows SDK.
TRUE if the window styles are modified; otherwise, FALSE.
Styles to be added or removed can be combined by using the bitwise OR ( | ) operator. See the CreateWindow function in the Windows SDKfor information about the available window styles.
If nFlags is nonzero, ModifyStyle calls the Win32 function SetWindowPos, and redraws the window by combining nFlags with the following four flags:
-
SWP_NOSIZE Retains the current size.
-
SWP_NOMOVE Retains the current position.
-
SWP_NOZORDER Retains the current Z order.
-
SWP_NOACTIVATE Does not activate the window.
To modify a window's extended styles, call ModifyStyleEx.
[!code-cppNVC_ATL_Windowing#25]
Modifies the extended window styles of the CWindow object.
BOOL ModifyStyleEx(
DWORD dwRemove,
DWORD dwAdd,
UINT nFlags = 0) throw();
dwRemove
[in] Specifies the extended styles to be removed during style modification.
dwAdd
[in] Specifies the extended styles to be added during style modification.
nFlags
[in] Window-positioning flags. For a list of possible values, see the SetWindowPos function in the Windows SDK.
TRUE if the extended window styles are modified; otherwise, FALSE.
Styles to be added or removed can be combined by using the bitwise OR ( | ) operator. See the CreateWindowEx function in the Windows SDKfor information about the available extended styles.
If nFlags is nonzero, ModifyStyleEx calls the Win32 function SetWindowPos, and redraws the window by combining nFlags with the following four flags:
-
SWP_NOSIZE Retains the current size.
-
SWP_NOMOVE Retains the current position.
-
SWP_NOZORDER Retains the current Z order.
-
SWP_NOACTIVATE Does not activate the window.
To modify windows using regular window styles, call ModifyStyle.
[!code-cppNVC_ATL_Windowing#26]
Changes the window's size and position.
BOOL MoveWindow(
int x,
int y,
int nWidth,
int nHeight,
BOOL bRepaint = TRUE) throw();
BOOL MoveWindow(
LPCRECT lpRect,
BOOL bRepaint = TRUE) throw();
For a top-level window object, the x and y parameters are relative to the upper-left corner of the screen. For a child window object, they are relative to the upper-left corner of the parent window's client area.
The second version of this method uses a RECT structure to determine the window's new position, width, and height.
Sets the keyboard focus to the next control in the dialog box.
void NextDlgCtrl() const throw();
See WM_NEXTDLGCTL in the Windows SDK.
Opens the Clipboard.
BOOL OpenClipboard() throw();
See OpenClipboard in the Windows SDK.
Converts a CWindow object to an HWND.
operator HWND() const throw();
Assigns an HWND to the CWindow object by setting the m_hWnd member to hWnd.
CWindow& operator= (HWND hWnd) throw();
Places a message in the message queue associated with the thread that created the window.
BOOL PostMessage(
UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0) throw();
See PostMessage in the Windows SDK.
Returns without waiting for the thread to process the message.
[!code-cppNVC_ATL_Windowing#27]
Sets the keyboard focus to the previous control in the dialog box.
void PrevDlgCtrl() const throw();
See WM_NEXTDLGCTL in the Windows SDK.
Sends a WM_PRINT message to the window to request that it draw itself in the specified device context.
void Print(HDC hDC, DWORD dwFlags) const throw();
hDC
[in] The handle to a device context.
dwFlags
[in] Specifies the drawing options. You can combine one or more of the following flags:
-
PRF_CHECKVISIBLE Draw the window only if it is visible.
-
PRF_CHILDREN Draw all visible child windows.
-
PRF_CLIENT Draw the client area of the window.
-
PRF_ERASEBKGND Erase the background before drawing the window.
-
PRF_NONCLIENT Draw the non-client area of the window.
-
PRF_OWNED Draw all owned windows.
Sends a WM_PRINTCLIENT message to the window to request that it draw its client area in the specified device context.
void PrintClient(HDC hDC, DWORD dwFlags) const throw();
hDC
[in] The handle to a device context.
dwFlags
[in] Specifies drawing options. You can combine one or more of the following flags:
-
PRF_CHECKVISIBLE Draw the window only if it is visible.
-
PRF_CHILDREN Draw all visible child windows.
-
PRF_CLIENT Draw the client area of the window.
-
PRF_ERASEBKGND Erase the background before drawing the window.
-
PRF_NONCLIENT Draw the non-client area of the window.
-
PRF_OWNED Draw all owned windows.
Contains default window dimensions.
static RECT rcDefault;
Updates a specified rectangle or region in the client area.
BOOL RedrawWindow(
LPCRECT lpRectUpdate = NULL,
HRGN hRgnUpdate = NULL,
UINT flags = RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
throw()
See RedrawWindow in the Windows SDK.
[!code-cppNVC_ATL_Windowing#28]
Releases a device context.
int ReleaseDC(HDC hDC);
See ReleaseDC in the Windows SDK.
[!code-cppNVC_ATL_Windowing#9]
Resizes the window to the specified client area size.
BOOL ResizeClient(
int nWidth,
int nHeight,
BOOL bRedraw = FALSE) throw();
nWidth
New width of the window in pixels.
nHeight
New height of the window in pixels.
bRedraw
A flag indicating whether to redraw changes. Default is FALSE, indicating the window does not redraw changes.
Converts screen coordinates to client coordinates.
BOOL ScreenToClient(LPPOINT lpPoint) const throw();
BOOL ScreenToClient(LPRECT lpRect) const throw();
See ScreenToClient in the Windows SDK.
The second version of this method allows you to convert the coordinates of a RECT structure.
Scrolls the specified client area.
BOOL ScrollWindow(
int xAmount,
int yAmount,
LPCRECT lpRect = NULL,
LPCRECT lpClipRect = NULL) throw();
See ScrollWindow in the Windows SDK.
Scrolls the specified client area with additional features.
int ScrollWindowEx(
int dx,
int dy,
LPCRECT lpRectScroll,
LPCRECT lpRectClip,
HRGN hRgnUpdate,
LPRECT lpRectUpdate,
UINT flags) throw();
See ScrollWindowEx in the Windows SDK.
Sends a message to a control.
LRESULT SendDlgItemMessage(
int nID,
UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0) throw();
See SendDlgItemMessage in the Windows SDK.
Sends a message to the window and does not return until the window procedure has processed the message.
LRESULT SendMessage(
UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0) throw();
static LRESULT SendMessage(
HWND hWnd,
UINT message,
WPARAM wParam,
LPARAM lParam) throw();
See SendMessage in the Windows SDK.
[!code-cppNVC_ATL_Windowing#29]
Sends the specified message to all immediate children of the CWindow object.
void SendMessageToDescendants(
UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0,
BOOL bDeep = TRUE) throw();
message
[in] The message to be sent.
wParam
[in] Additional message-specific information.
lParam
[in] Additional message-specific information.
bDeep
[in] If TRUE (the default value), the message will be sent to all descendant windows; otherwise, it will be sent only to the immediate child windows.
If bDeep is TRUE, the message is additionally sent to all other descendant windows.
Sends a message to the window.
BOOL SendNotifyMessage(
UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0) throw();
See SendNotifyMessage in the Windows SDK.
If the window was created by the calling thread, SendNotifyMessage does not return until the window procedure has processed the message. Otherwise, it returns immediately.
Activates the window.
HWND SetActiveWindow() throw();
See SetActiveWindow in the Windows SDK.
[!code-cppNVC_ATL_Windowing#30]
Sends all subsequent mouse input to the window.
HWND SetCapture() throw();
See SetCapture in the Windows SDK.
Adds the window to the Clipboard viewer chain.
HWND SetClipboardViewer() throw();
See SetClipboardViewer in the Windows SDK.
Sets the identifier of the window to the specified value.
int SetDlgCtrlID(int nID) throw();
nID
[in] The new value to set for the window's identifier.
If successful, the previous identifier of the window; otherwise 0.
Changes a control's text to the string representation of an integer value.
BOOL SetDlgItemInt(
int nID,
UINT nValue,
BOOL bSigned = TRUE) throw();
See SetDlgItemInt in the Windows SDK.
Changes a control's text.
BOOL SetDlgItemText(int nID, LPCTSTR lpszString) throw();
See SetDlgItemText in the Windows SDK.
Sets the input focus to the window.
HWND SetFocus() throw();
See SetFocus in the Windows SDK.
[!code-cppNVC_ATL_Windowing#31]
Changes the window's current font by sending a WM_SETFONT message to the window.
void SetFont(HFONT hFont, BOOL bRedraw = TRUE) throw();
hFont
[in] The handle to the new font.
bRedraw
[in] If TRUE (the default value), the window is redrawn. Otherwise, it is not.
Associates a hot key with the window by sending a WM_SETHOTKEY message.
int SetHotKey(WORD wVirtualKeyCode, WORD wModifiers) throw();
wVirtualKeyCode
[in] The virtual key code of the hot key. For a list of standard virtual key codes, see Winuser.h.
wModifiers
[in] The modifiers of the hot key. For a list of possible values, see WM_SETHOTKEY in the Windows SDK.
For a list of possible return values, see WM_SETHOTKEY in the Windows SDK.
Sets the window's large or small icon to the icon identified by hIcon.
HICON SetIcon(HICON hIcon, BOOL bBigIcon = TRUE) throw();
hIcon
[in] The handle to a new icon.
bBigIcon
[in] If TRUE (the default value), the method sets a large icon. Otherwise, it sets a small icon.
The handle to the previous icon.
SetIcon sends a WM_SETICON message to the window.
Changes the window's current menu.
BOOL SetMenu(HMENU hMenu) throw();
See SetMenu in the Windows SDK.
Changes the parent window.
HWND SetParent(HWND hWndNewParent) throw();
See SetParent in the Windows SDK.
[!code-cppNVC_ATL_Windowing#32]
Sets or clears the redraw flag by sending a WM_SETREDRAW message to the window.
void SetRedraw(BOOL bRedraw = TRUE) throw();
bRedraw
[in] Specifies the state of the redraw flag. If TRUE (the default value), the redraw flag is set; if FALSE, the flag is cleared.
Call SetRedraw to allow changes to be redrawn or to prevent changes from being redrawn.
[!code-cppNVC_ATL_Windowing#33]
Sets the parameters of a scroll bar.
int SetScrollInfo(
int nBar,
LPSCROLLINFO lpScrollInfo,
BOOL bRedraw = TRUE) throw();
See SetScrollInfo in the Windows SDK.
Changes the position of the scroll box.
int SetScrollPos(
int nBar,
int nPos,
BOOL bRedraw = TRUE) throw();
See SetScrollPos in the Windows SDK.
Changes the scroll bar range.
BOOL SetScrollRange(
int nBar,
int nMinPos,
int nMaxPos,
BOOL bRedraw = TRUE) throw();
See SetScrollRange in the Windows SDK.
Creates a timer event.
UINT SetTimer(
UINT nIDEvent,
UINT nElapse,
void (CALLBACK* lpfnTimer)(HWND, UINT, UINT, DWORD) = NULL) throw();
See SetTimer in the Windows SDK.
Sets the window's help context identifier.
BOOL SetWindowContextHelpId(DWORD dwContextHelpId) throw();
See SetWindowContextHelpId in the Windows SDK.
Sets a 32-bit value at a specified offset into the extra window memory.
LONG SetWindowLong(int nIndex, LONG dwNewLong) throw();
See SetWindowLong in the Windows SDK.
Note
To write code that is compatible with both 32-bit and 64-bit versions of Windows, use CWindow::SetWindowLongPtr.
Changes an attribute of the specified window, and also sets a value at the specified offset in the extra window memory.
LONG_PTR SetWindowLongPtr(int nIndex, LONG_PTR dwNewLong) throw();
See SetWindowLongPtr in the Windows SDK.
This function supersedes the CWindow::SetWindowLong method. To write code that is compatible with both 32-bit and 64-bit versions of Windows, use CWindow::SetWindowLongPtr.
Sets the show state and positions.
BOOL SetWindowPlacement(const WINDOWPLACEMENT FAR* lpwndpl);
See SetWindowPlacement in the Windows SDK.
Sets the size, position, and Z order.
BOOL SetWindowPos(
HWND hWndInsertAfter,
int x,
int y,
int cx,
int cy,
UINT nFlags) throw();
BOOL SetWindowPos(
HWND hWndInsertAfter,
LPCRECT lpRect,
UINT nFlags) throw();
See SetWindowPos in the Windows SDK.
The second version of this method uses a RECT structure to set the window's new position, width, and height.
Sets the window region of a window.
int SetWindowRgn(HRGN hRgn, BOOL bRedraw = FALSE) throw();
See SetWindowRgn in the Windows SDK.
Changes the window's text.
BOOL SetWindowText(LPCTSTR lpszString) throw();
See SetWindowText in the Windows SDK.
[!code-cppNVC_ATL_Windowing#34]
Sets a 16-bit value at a specified offset into the extra window memory.
WORD SetWindowWord(int nIndex, WORD wNewWord) throw();
See SetWindowLong in the Windows SDK.
Displays the system caret.
BOOL ShowCaret() throw();
See ShowCaret in the Windows SDK.
[!code-cppNVC_ATL_Windowing#35]
Shows or hides the pop-up windows owned by the window.
BOOL ShowOwnedPopups(BOOL bShow = TRUE) throw();
See ShowOwnedPopups in the Windows SDK.
Shows or hides a scroll bar.
BOOL ShowScrollBar(UINT nBar, BOOL bShow = TRUE) throw();
See ShowScrollBar in the Windows SDK.
Sets the window's show state.
BOOL ShowWindow(int nCmdShow) throw();
See ShowWindow in the Windows SDK.
[!code-cppNVC_ATL_Windowing#36]
Sets the show state of a window created by a different thread.
BOOL ShowWindowAsync(int nCmdShow) throw();
See ShowWindowAsync in the Windows SDK.
Updates the client area.
BOOL UpdateWindow() throw();
See UpdateWindow in the Windows SDK.
[!code-cppNVC_ATL_Windowing#37]
Validates the client area within the specified rectangle.
BOOL ValidateRect(LPCRECT lpRect) throw();
See ValidateRect in the Windows SDK.
Validates the client area within the specified region.
BOOL ValidateRgn(HRGN hRgn) throw();
See ValidateRgn in the Windows SDK.
Starts Windows Help.
BOOL WinHelp(
LPCTSTR lpszHelp,
UINT nCmd = HELP_CONTEXT,
DWORD dwData = 0) throw();
See WinHelp in the Windows SDK.