void SuperbikeControl::GetChildWindow(CWnd *cwnd)
{
    CWnd *wnd = cwnd->GetWindow (GW_CHILD);
    if (wnd != NULL)
    {
        wnd->PostMessageW (WM_KEYDOWN, VK_ESCAPE, 0);
        Sleep(50);
        wnd->PostMessageW (WM_KEYUP, VK_ESCAPE, 0);
        PlaySound(_T("sound\\bell.wav"), NULL, SND_FILENAME | SND_ASYNC);
        Sleep(1000);
        GetChildWindow(wnd);
    }
    else
    {
        wnd = cwnd->GetWindow (GW_HWNDNEXT);
        if (wnd != NULL)
        {
            wnd->PostMessageW (WM_KEYDOWN, VK_ESCAPE, 0);
            Sleep(50);
            wnd->PostMessageW (WM_KEYUP, VK_ESCAPE, 0);
            PlaySound(_T("sound\\bell.wav"), NULL, SND_FILENAME | SND_ASYNC);
            Sleep(1000);
            GetChildWindow(wnd);
        }
    }

}

posted on 2012-02-14 14:22  知识天地  阅读(515)  评论(0编辑  收藏  举报