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

posted @ 2010-05-04 16:53  傲衣华少  阅读(181)  评论(0编辑  收藏  举报