1. 模态窗体的实现

    bool CWindowWnd::ShowModal()
    {
       ASSERT(::IsWindow(m_hWnd));
       
       HWND hWndParent = GetWindowOwner(m_hWnd);
       ::ShowWindow(m_hWnd, SW_SHOWNORMAL);
       ::EnableWindow(hWndParent, FALSE);
       MSG msg = { 0 };
       while( ::IsWindow(m_hWnd) && ::GetMessage(&msg, NULL, 0, 0) ) {
          if( msg.message == WM_CLOSE ) {
             ::EnableWindow(hWndParent, TRUE);
             ::SetFocus(hWndParent);
          }
          if( !CPaintManagerUI::TranslateMessage(&msg) ) {
             ::TranslateMessage(&msg);
             ::DispatchMessage(&msg);
          }
          if( msg.message == WM_QUIT ) break;
       }
       ::EnableWindow(hWndParent, TRUE);
       ::SetFocus(hWndParent);
       if( msg.message == WM_QUIT ) ::PostQuitMessage(msg.wParam);
       return true;
    }
    


  2. 谈谈父窗口和所有者窗口
  3. WM_NCCREATE
  4. GWLP_USERDATA
    Sets the user data associated with the window. This data is intended for use by the application that created the window. Its value is initially zero.
  5. 《C++设计新思维》读书笔记

相关文章:

  • 2021-10-07
  • 2022-01-03
  • 2021-10-01
  • 2022-02-27
  • 2022-01-13
  • 2021-05-22
  • 2022-12-23
  • 2021-12-02
猜你喜欢
  • 2021-11-13
  • 2021-04-27
  • 2022-12-23
  • 2021-06-03
  • 2021-10-18
  • 2021-08-13
相关资源
相似解决方案