现在的位置: 首页 > 综合 > 正文

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

2012年04月28日 ⁄ 综合 ⁄ 共 414字 ⁄ 字号 评论关闭

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

抱歉!评论已关闭.