AfxCWindowPtrfunction
Returns a pointer to the **CWindow** class given the handle of the main window or the CREATESTRUCT structure associated with it.
Syntax
FUNCTION AfxCWindowPtr (BYVAL hwnd AS HWND) AS CWindow PTR
FUNCTION AfxCWindowPtr (BYVAL lParam AS LPARAM) AS CWindow PTR
FUNCTION AfxCWindowPtr (BYVAL pCreateStruct AS CREATESTRUCT PTR) AS CWindow PTR
Parameters
| Name | Description | |
|---|---|---|
hwnd | Handle of the main window created with the Create method of the CWindow class. | |
lParam | Value passed by Windows to the WM_CREATE message. | |
pCreateStruct | Pointer to the CREATESTRUCT structure used by Windows during the window creation and passed to the window procedure as the lParam parameter of the WM_CREATE message. |
Return value
A pointer to the CWindow class or NULL.
Description
Returns a pointer to the CWindow class given the handle of the main window or the CREATESTRUCT structure associated with it. To retrieve it from the handle of any of its child windows or controls, use AfxCWindowOwnerPtr.
Examples
DIM pWindow AS CWindow PTR = AfxCWindowPtr(hwnd)
DIM pWindow AS CWindow PTR = AfxCWindowPtr(lParam)
Reference
- Include file
CWindow.inc - Defined in AfxNova/CWindow.inc:2577
- Documented in Windows/Windows GUI/CWindow Class.md
- Topic: CWindow Class