void CDemoDlg::OnBnClickedButton1()
{
// TODO: 在此添加控件通知处理程序代码
HWND hWnd = GetSafeHwnd();
CWnd* pWnd = CWnd::FromHandle(hWnd);
CString s;
s.Format(_T("pWnd = 0x%X\nthis = 0x%X\n"), pWnd, this);
AfxMessageBox(s);
}
void CDemoDlg::OnBnClickedButton2()
{
// TODO: 在此添加控件通知处理程序代码
CDemoApp* pApp = (CDemoApp*)AfxGetApp();
CWnd* pMainWnd = pApp->m_pMainWnd;
CString s;
s.Format(_T("pMainWnd = 0x%X\nthis = 0x%X"), pMainWnd, this);
AfxMessageBox(s);
}
博客围绕C++窗口指针的使用展开,但具体内容缺失。C++作为后端开发语言,窗口指针在相关编程中有着重要作用,可用于操作窗口对象等。
3667

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



