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他们的拥有者。
奇怪,父窗口和拥有者不是一样的吗???
解决方案 »
- APP的WriteProfileString究竟是写在什么位置?
- 补文档有什么好方法 Visual Studio
- CArchive的使用
- windbg
- 关于将图片通过AV或VGA信号传送的问题
- 菜鸟请教自定义消息的问题。
- 请问如何才能杀死其它行程中的窗口。
- 请教大家,ARP欺骗是否能禁止用户上internet,我用路由器的IP做下面机子的网关,用WIN98,机房用switch,用这种方法会不会使到我不能访问局域
- 為何我的程序在編譯時能通過,運行也可以,但是當我運行release和debug目錄下的.exe時就不行了??
- 高手请进···
- MFC怎么保存一个rect内的图片
- VC中多行编辑框行数定位问题的求解
POPUP类型创建它的不一定是它的父窗口
一个对话框上用BltBit画2张图片,来回切换。我想使该对话框在 主界面的中央处, 于是用了函数:CWnd::CenterWindow();不过用的时候,参数用了 默认值NULL.造成的后果: 对话框倒是在主界面的中央了, 但是 图片看不到了
请问,这是什么原因导致的。
工程是基于单文档工程。