HWND hWnd=GetSafeHwnd(); CWnd* pWnd=CWnd::FromHandle (hWnd); CString strText=_T(""); strText.Format ("pWnd=0x%X/nthis=0x%X/n",pWnd,this); AfxMessageBox(strText);