CWnd is also a shorthand for the congested Windows (congestion window) in the computer network. The size of the congestion window depends on the degree of congestion of the network and is dynamically changing. The sender makes its own sending window possibly smaller than the congested window.
CWnd is the base class for MFC window classes and provides the basic functionality of all Windows classes in the Microsoft Base Class library.
The Cwnd::fromhandle function can be called by obtaining CWnd pointers through the HWND.
Static cwnd* PASCAL FromHandle (HWND hwnd);
void Cmy2014121108dlg::onbnclickedbutton1 () {
Gets the current window handle HWND hwnd = GetSafeHwnd ();
Obtain CWnd pointer via hwnd cwnd* PWND = Cwnd::fromhandle (hwnd); CString StrText = _t (""); Strtext.format ("pWnd = 0x%x\nthis = ox%x\n", pWnd, this); AfxMessageBox (StrText);//TODO: Add control notification handler code here}
Get CWnd pointers through HWND