zip's

while(true) { Write it down; Think about it; Refine it; Sleep(); }

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

通常需要:1,设置窗口的父子关系;2,确定弹出窗口的初始显示位置;

void CMainFrame::OnDoSomething() 
{
    WndWpf^ wnd = gcnew WndWpf();
    WindowInteropHelper^ wndHelper = gcnew WindowInteropHelper(wnd);
    IntPtr ptr(this->GetSafeHwnd());
    wndHelper->Owner = ptr;
    
    // move the window to (left, top) of client area
    CRect rc;
    this->GetClientRect(&rc);
    this->ClientToScreen(&rc);
    wnd->Left = rc.left;
    wnd->Top = rc.top;
    
    wnd->Show();
}

-

posted on 2011-06-08 17:35  zip's  阅读(1086)  评论(0编辑  收藏  举报