读书人

CWindow:CenterWindow函数解决方法

发布时间: 2014-05-31 16:45:33 作者: rapoo

CWindow::CenterWindow函数

C/C++ code
CWindow::CenterWindow函数体温msdn:Usually called from CDialog::OnInitDialog to center dialog boxes relative to the main window of the application. By default, the function centers child windows relative to their parent window, and pop-up windows relative to their owner. If the pop-up window is not owned, it is centered relative to the screen. To center a window relative to a specific window which is not the owner or parent, the pAlternateOwner parameter may be set to a valid window. To force centering relative to the screen, pass the value returned by CWnd::GetDesktopWindow as pAlternateOwner.这段英文条几个概念:该函数会使子窗口 Centers他们 的父窗口, pop-up窗口Centers他们的拥有者。奇怪,父窗口和拥有者不是一样的吗???


[解决办法]
CHILD类型的创建它的即它的父窗口
POPUP类型创建它的不一定是它的父窗口
[解决办法]
呵呵
多测试一下
你的问题我觉得多半和刷新有关

读书人网 >VC/MFC

热点推荐