Get CWnd pointers through HWND

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.