怎么在vc中判断一个窗口是否已经关闭
解决方案 »
- error C2061: syntax error : identifier 'VERTEXARY'是什么原因
- 目录设置问题
- InvokeHelper这个不大会用,谁能给我详细解说下,谢谢//.
- _RecordsetPtr执行SQL语句中有group by不支持怎么办?
- [求助]vc怎样才能处理raw(potoshop)格式的图片?
- 我的U盘插入后,提示没有格式化,要你格式化,但是我的U盘上还有我的重要数据,如何挽救我的数据?
- 如何把MP3文件加载到内存中并播放
- 如何实现用鼠标拖动一串字符?(字符随鼠标移动)字符串在移动时事是透明的!
- 急!flex++和bison++生成的程序在VC下无法编译通过
- 请问如何手工修改Appwizard生成的类的基类?
- 太简单的问题:怎么使Combox的文字不可编辑,怎么使Edit的文字不可编辑
- 继承CFileDialog出问题了
IsWindow
The IsWindow function determines whether the specified window handle identifies an existing window. BOOL IsWindow(
HWND hWnd // handle to window
);
Parameters
hWnd
[in] Handle to the window to test.
Return Values
If the window handle identifies an existing window, the return value is nonzero.If the window handle does not identify an existing window, the return value is zero. Res
A thread should not use IsWindow for a window that it did not create because the window could be destroyed after this function was called. Further, because window handles are recycled the handle could even point to a different window.
另外有一个菜单控制,执行时如果工具栏关闭,则重建。代码:
int CMainFrame::OpenToolBar ()
{
if(!::IsWindow(m_wndToolBar.m_hWnd) )
{
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_TOOLBAR1) )//||
//!m_wndToolBar.SetButtons(ToolsA, sizeof(ToolsA)/sizeof(UINT)))
{
TRACE0("Failed to create the light toolbar.\n");
return -1; // if failed to create
} m_wndToolBar.EnableDocking (CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 1;
}
}但是不行
CFrameWnd::ShowControlBarSee Also
CFrameWnd Overview | Class Members | Hierarchy Chart
Call this member function to show or hide the control bar.void ShowControlBar(
CControlBar* pBar,
BOOL bShow,
BOOL bDelay
);
Parameters
pBar
Pointer to the control bar to be shown or hidden.
bShow
If TRUE, specifies that the control bar is to be shown. If FALSE, specifies that the control bar is to be hidden.
bDelay
If TRUE, delay showing the control bar. If FALSE, show the control bar immediately.
来显示和隐藏工具栏,判断工具栏是否已经显示可以用
CWnd::IsWindowVisible
This method determines the visibility state of the specified window. BOOL IsWindowVisible( )
const;
Return Value
Nonzero if CWnd is visible, that is, has the WS_VISIBLE style bit set, and parent window is visible. Because the return value reflects the state of the WS_VISIBLE style bit, the return value may be nonzero even though CWnd is totally obscured by other windows.或者
CControlBar* pBar;//某个工具栏的指针
...
(pBar->GetStyle() & WS_VISIBLE) != 0;//说明显示了
可以给我发email,我给你一个这方面的例子[email protected]