闂備浇銆€閸嬫捇鏌熼婊冾暭妞ゃ儻鎷� (0) +1 闂佽崵濮嶅鍡楊伓 (0) +1 闂傚倸饪存禍鐑藉箯閿燂拷 (0) +1
闂備浇銆€閸嬫捇鏌熼婊冾暭妞ゃ儲鍨块弻鐔衡偓娑櫭慨鍥р攽椤曞棙瀚�闂備礁鎼悮顐﹀磿閸愯鑰块柛娑欐綑缂佲晠鏌熼婊冾暭妞ゃ儻鎷�>>

正在阅读:实用!超强VC/MFC 常见问答收集实用!超强VC/MFC 常见问答收集

2004-07-15 10:04 出处:CSDN 作者:jiangsheng收集 责任编辑:linjixiong


{
  ESErrPrintProviderError(g_connection);
  ESErrPrintComError(e);
  return e.Error();
 }
 return S_OK;
}
STDMETHODIMP CEnumDataType::Clone(IEnumString** ppenum)
{
 if (!ppenum)
  return E_POINTER;
 
 CEnumDataType* pnew = new CEnumDataType(m_strDataType);
 pnew->AddRef();
 *ppenum = pnew;
 return S_OK;
}

 

  问:如何在MDI环境下枚举所有打开的窗口?
  答:
In MFC, each CMDIChildWnd created by the framework is managed as a child window of the MDIClient window. This MDIClient window is a child of the mainframe window and fills its client area. For MDI applications, the mainframe window is encapsulated by the CMDIFrameWnd class. This class has a public embedded HWND member (m_hWndMDIClient), which is the handle to the MDIClient window. For MDI applications, AppWizard derives the CMainFrame class from CMDIFrameWnd.

The MDIClient maintains an internal list of child windows. In an MFC application, these child windows are either a CMDIChildWnd object or an internal window used to display the title of an iconized window. Note that this is an internal list controlled by Windows; don't make assumptions about the ordering of children in the list after an API function is called.


//**mainfrm.h****************
class CMainFrame : public CMDIFrameWnd
{
...
public:
   CWnd  m_wndMDIClient;
   CWnd* m_pWndCurrentChild;
   CMDIChildWnd* GetNextMDIChildWnd();
   int GetCountCMDIChildWnds();
...
}

//**mainfrm.cpp**************
CMainFrame::CMainFrame():m_pWndCurrentChild(NULL)
{
  //.................
}

CMainFrame::~CMainFrame()

 


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:

键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品
闂備礁缍婂ḿ褔顢栭崱妞绘敠闁逞屽墴閹鎷呴崨濠備淮濠碘槅鍋撻幏锟�闂備焦鎮堕崕鎶藉磻濞戙垹鏄ラ悘鐐板嫎娴滄粓鏌涢锝嗙闁告棑鎷�