1.CWnd

对于基于CWnd的类,如对话框
比如CXXXDialog

在对话框内部那就是
(CWnd*)this ;

如果定义的
CXXXDialog dlg ;
就是 (CWnd*)&dlg ;

如果是对话框的控件如IDC_EDIT1
CWnd *pEdit = GetDlgItem( IDC_EDIT1 ) ;

2.HWND

例如:  
  在CFormView或者CDialog内部:  
  HWND   hWnd   =   GetSafeHwnd();  
   
  否则:  
  CFormView   *pView   =   ......;  
  HWND   hWndFormView   =   pView->GetSafeHwnd();  
   
  CDialog   *pDlg   =   ......  
  HWND   hWndDlg   =   pDlg->GetSafeHwnd();  

相关文章:

  • 2021-05-30
  • 2021-06-07
  • 2022-02-13
  • 2021-12-13
  • 2021-10-26
  • 2022-01-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2022-12-23
相关资源
相似解决方案