稳定盈利的期货交易方法-量化趋势交易

alantop -专业量化投资者

爱好:量化投资,逆向工程,渗透
随笔 - 595, 文章 - 0, 评论 - 921, 引用 - 0
数据加载中……

EnumChildWindows Function

The EnumChildWindows function enumerates the child windows that belong to the specified parent window by passing the handle to each child window, in turn, to an application-defined callback function. EnumChildWindows continues until the last child window is enumerated or the callback function returns FALSE.

 

主框架调用EnumChildWindows让每个子窗口都去执行SendPrepareToClose去做每个子窗口的清理工作。

BOOL CMainFrame::DestroyWindow()
{
    ::EnumChildWindows(m_hWnd, SendPrepareToClose, 0);

    return CMDIFrameWnd::DestroyWindow();
}

 

static BOOL CALLBACK SendPrepareToClose(HWND hWnd, LPARAM)
{
    CWnd* pWnd = CWnd::FromHandlePermanent(hWnd);
    if (pWnd != NULL)
    {
        pWnd->SendMessage(WM_USER_PREPARE_TO_CLOSE);
        if (pWnd->GetWindow(GW_CHILD) != NULL)
            ::EnumChildWindows(pWnd->m_hWnd, SendPrepareToClose, 0);
    }
    return TRUE;
}

posted on 2007-07-16 18:34 AlanTop 阅读(715) 评论(0)  编辑 收藏 引用 所属分类: VC++


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理