做了个dx的程序 在dx窗口可见的时候 由于有垂直同步 cpu正常工作
但是一旦画面窗口不可见了 cpu就要跑到100%
于是我就想判断某个控件是否可以看见
看见是指未隐藏,没有被其他窗口覆盖,或者没有在一个tabpage中给转到后面!control 的Visible 不用说了 肯定不满足,Capture 和Focused 也不对.
还有什么方法么?
但是一旦画面窗口不可见了 cpu就要跑到100%
于是我就想判断某个控件是否可以看见
看见是指未隐藏,没有被其他窗口覆盖,或者没有在一个tabpage中给转到后面!control 的Visible 不用说了 肯定不满足,Capture 和Focused 也不对.
还有什么方法么?
LZ说的是WINFROM啊~~不可见CPU100%了 感觉是你程序的问题把。。
If the specified window, its parent window, its parent's parent window, and so forth, have the WS_VISIBLE style, the return value is nonzero. Otherwise, the return value is zero. Because the return value specifies whether the window has the WS_VISIBLE style, it may be nonzero even if the window is totally obscured by other windows.
遮挡得写另外的逻辑,window默认没有逻辑和API去判断这个的。
如果你的是被自己的窗体或控件遮住了,自己应该是知道的;
如果window不是你的,一般是不知道是否可见的。你可以通过GetWindowRect尝试获得window的举行区域,然后判断该区域里有没有window在你的控件的window前面