我在一个非模态窗体中,创建并打开另一个非模态窗体,后代开的窗体总是隐藏在前面打开窗体的后面。如何才能将后面的窗体推到前面来显示?很简单的问题,请大家多多指教了~~
解决方案 »
- 无效指针
- 获取本机IP地址的奇怪问题
- VC window应用程序打印输出
- 一个CArray对象,要使用它的add()函数,是不是要重载operator=() ?
- 对话框中的SendMessage和MessageBox的超基本问题
- 大家看看我的ftp能不能正常工作
- 哪里有下载像Linux下C/C++语言的工具(优化、美化C/C++源代码等)
- mfc程序与win32 console application之间怎样通信?
- 请教IOCP,connectex返回WSA_IO_PENDING,是不是就可以投递WSARECV了?
- 每个人都会碰到的问题。
- 怎样救治我的IE浏览器????
- win98,win95下的新建文件共享用什么命令?(win2000下的net share用不起来)
HWND hWnd // handle to window
);用这个试试,或者直接调用 CWnd::BringWindowToTop();
MSDN
HWND hWnd, // handle to window
HWND hWndInsertAfter, // placement-order handle
int X, // horizontal position
int Y, // vertical position
int cx, // width
int cy, // height
UINT uFlags // window-positioning flags
);
Handle to the window to precede the positioned window in the Z order. This parameter must be a window handle or one of the following values: Value Meaning
HWND_BOTTOM Places the window at the bottom of the Z order. If the hWnd parameter identifies a topmost window, the window loses its topmost status and is placed at the bottom of all other windows.
HWND_NOTOPMOST Places the window above all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window.
HWND_TOP Places the window at the top of the Z order.
HWND_TOPMOST Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated.
For more information about how this parameter is used, see the following Res section.
{
if( bMost == TRUE )
{
SetWindowPos(&CWnd::wndTopMost,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE);
}
else
{
SetWindowPos(&CWnd::wndNoTopMost,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE);
}
}