Windows程序设计 读书笔记 - 多文档界面

BOOL CALLBACK CloseEnumProc (HWND hwnd, LPARAM lParam)

{

  if (GetWindow (hwnd, GW_OWNER))         // Check for icon title
          return TRUE ;
     
     SendMessage (GetParent (hwnd), WM_MDIRESTORE, (WPARAM) hwnd, 0) ;
     
     if (!SendMessage (hwnd, WM_QUERYENDSESSION, 0, 0))
          return TRUE ;
     
     SendMessage (GetParent (hwnd), WM_MDIDESTROY, (WPARAM) hwnd, 0) ;
     return TRUE ;

}

EnumChildWindows (hwndClient, CloseEnumProc, 0) ;//所有子窗口执行CloseEnumProc

你可能感兴趣的:(windows)