单文档工程中,我创建了一个显示splash的类,我在CMainFrame的Create函数中显示splash
,但是为什么我的splash 不是在窗口的最前面,而是在单文档的后面呢?
,但是为什么我的splash 不是在窗口的最前面,而是在单文档的后面呢?
解决方案 »
- 作为大四的学生要去找关于C/C++程序员的实习工作了,请各位大哥提些建议
- 已知文件的目录路径,怎么查找以dsw为后缀名的文件?
- 为什么分割窗体后右边的View中添加的菜单相应函数无效??
- 有关ocx的注册问题
- +++++++++关于SetCapture()的问题++++++++++++++
- 如果ADO连接已经断掉了,如何判断出来!!!!急
- 用VC++做一个锁屏的小软件
- 新手求助:CryptoPP的签名验证的使用
- 郭均辉 是男的还是女的?是大人还是小孩?
- 请问如何使用CArray这个类构造自己的数组
- 奇怪!多文档结构打开位图,只能“新建”不能“打开”?请指教。
- fatal error C1853: 'Release/Ex08.pch' is not a precompiled header file created with this compiler
两种途径.
BringWindowToTop(Handle);
SetWindowPos函数,指定窗口的 最顶风格,用WS_EX_TOPMOST扩展窗口的 风格 Example:
void ToggleTopMost( CWnd *pWnd)
{
ASSERT_VALID(pWnd);
pWnd ->SetWindowPos(pWnd-> GetStyle( ) &WS_EX_TOPMOST)?
&wndNoTopMOST: &wndTopMost,0,0,0,0,SSP_NOSIZE|WSP_NOMOVE);
}
HWND hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
UINT uFlags
);::SetWindowPos(GetSafeHwnd,HWND_TOPMOST,0,0,0,0,WSP_NOSIZE|WSP_NOMOVE);
看看我的代码是不是有问题
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
} if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
} // TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
CWelcome::ShowSplashWnd(this);
CWelcome::ToggleTopMost(this);
//CWelcome::ShowSplashScreen(this);
//Sleep(2000);
return 0;
}
但是如果去掉的话,那么splash总是显示在后面
不知是为什么