The window object is an object of the C++ CWnd class (or a derived class) that your program creates directly. It comes and goes in response to your program's constructor and destructor calls.
The Windows window, on the other hand, is an opaque handle to an internal Windows data structure that corresponds to a window and consumes system resources when present.
A Windows window is identified by a "window handle" (HWND句柄) and is created after the CWnd object is created by a call to the Create member function of class CWnd窗口类.
The window may be destroyed either by a program call or by a user's action. The window handle is stored in the window object's m_hWnd member variable.
The following figure shows the relationship between the C++ window object and the Windows window. Creating windows is discussed in Creating Windows. Destroying windows is discussed in Destroying Window Objects.

Window Object and Windows Window
原来如此
本文探讨了C++中CWnd对象与Windows窗口之间的关联。CWnd对象直接由程序创建,而Windows窗口则通过CWnd对象的Create成员函数调用创建,标识为窗口句柄(HWND)。文中详细解释了窗口的创建与销毁过程,以及窗口句柄在CWnd对象中的存储方式。
1733

被折叠的 条评论
为什么被折叠?



