怎样判断已知窗口有否被其他窗口遮住?
不在最顶端的窗口不一定会被遮住
不在最顶端的窗口不一定会被遮住
解决方案 »
- 封装LUA遇到的问题!!!
- 保存位图 提out of memory
- 急 ★★★★急!用C++实现对内存中内容的zip/rar算法压缩解压缩?
- 对话框中操作视类指针出错的问题?急救
- 窗口和窗口控件的拖拽
- Dll : 为什么VC开发的Dll函数参数 char* 在VB中不能调用(再问)?
- 请教高手:型号为 es2838s c030 的猫的驱动程序到哪下载?
- 有人用过SetSuspendState这个API吗?我没找到include它的头文件
- 带汉字的CString在Unicode编码下如何转换成char *
- 紧急通知!!!!!!!!!
- tcp数据通信的时候为什么数据包会被自动分成多个包?
- 请问如何为对话框程序制作真彩色启动封面?
或者通过枚举窗口并取窗口位置来进行计算
int IsWindowVisibleEx(HWND hwnd)
{
int nResult = 0;
if(::IsWindow(hwnd))
{
HDC hdc = GetDC(hwnd);
RECT rcClip, rcClient;
GetClientRect(hwnd, &rcClient);
nResult = GetClipBox(hdc, &rcClip);
ReleaseDC(hwnd, hdc));if(nResult == NULLREGION) // Totally obscured
nResult = 0;
else if(nResult == SIMPLEREGION && EqualRect(&rcClip, &rcClient)) // Completely visible
nResult = 1;
else // Partially visible
nResult = -1;
}
}
return nResult;
}
BOOL IsWindowVisible( ) const;Return ValueNonzero if CWnd is visible (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.如果CWnd可见(被设值了WS_VISIBLE风格位,其父窗口可见),则返回非零值。因为返回值反映了WS_VISIBLE风格位的状态,因此即使CWnd被其它窗口完全遮住,返回值也可以是非零值 ResDetermines the visibility state of the given window. 这个函数确定给定窗口的视觉状态。 A window possesses a visibility state indicated by the WS_VISIBLE style bit. When this style bit is set with a call to the ShowWindow member function, the window is displayed and subsequent drawing to the window is displayed as long as the window has the style bit set.窗口具有在WS_VISIBLE风格位中指定的可视状态。当用ShowWindow成员函数设置了这个风格位时,将显示窗口,后来在窗口中的绘图也一直显示。 Any drawing to a window that has the WS_VISIBLE style will not be displayed if the window is covered by other windows or is clipped by its parent window.当窗口被其它窗口覆盖或被父窗口裁剪时,在具有WS_VISIBLE风格位的窗口内的绘图将不会显示。