title: What is the WindowProc of "MDI Client Window“ in MFC
body: <p>guys ,
  I am a new commer ,and I have just started to study MFC.
  I have a question about the MDI application framework.
  In MFC.
  I leaned from the code that a ChildFrame is always created by MDI Client Window when I new a file.
  But I can not find what's the WindowProc of "MDI Client Window“ in MFC.
  Actually,"MDI Client Window“ is created after we create the Main Frame.</p>
  
  <pre><code>winmdi.cpp
   // Create MDICLIENT control with special IDC
   if ((m_hWndMDIClient = ::AfxCtxCreateWindowEx(dwExStyle, _T("mdiclient"), NULL,
        dwStyle, 0, 0, 0, 0, m_hWnd, (HMENU)AFX_IDW_PANE_FIRST,
        AfxGetInstanceHandle(), (LPVOID)&amp;ccs)) == NULL)
  </code></pre>
  
  <p>About the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd373588%28v=vs.85%29.aspx" rel="nofollow">"MDI Client Window“</a></p>
  
  <p>And while we are creating a ChildFrame ,we send a WM_MDICREATE message to "MDI Client Window“,and then we get the Handle of the Window.</p>
  
  <pre><code>    winmdi.cpp
      BOOL CMDIChildWnd::Create(LPCTSTR lpszClassName,
   LPCTSTR lpszWindowName, DWORD dwStyle,
   const RECT&amp; rect, CMDIFrameWnd* pParentWnd,
   CCreateContext* pContext)
  
  {
  //......
   // create the window through the MDICLIENT window
   AfxHookWindowCreate(this);
   HWND hWnd = (HWND)::SendMessage(pParentWnd-&gt;m_hWndMDIClient,
        WM_MDICREATE, 0, (LPARAM)&amp;mcs);
  </code></pre>
  
  <p>About the WM_MDICREATE ,I found this information from Microsoft.
  *An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window.
  If the message succeeds, the return value is the handle to the new child window.
  If the message fails, the return value is NULL.*</p>
  
  <p>I guess,perhaps Windows the WindowProc from AfxGetInstanceHandle();But to be honest,I do not really know how it does so.</p>
  
  <p>AfxGetInstanceHandle
  <a href="http://msdn.microsoft.com/en-us/library/vstudio/36z3tfsb.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/vstudio/36z3tfsb.aspx</a>
  This function allows you to retrieve the instance handle of the current application.</p>
  
  <p>Please help me...
  Thank you very much indeed.</p>