c++ - Why does EnumWindows return more windows than I expected? -
In VC ++, I use EnumWindows (...), GetWindow (...), and GetWindowLong () To do this, check the windows list and check whether the window is the top window (not in the form of a second window owner), and what the window is showing (WS_VISIBLE) However, although my desktop is showing only 5 windows, this EnumWindows I'm giving 50 windows, how odd it is! Any windows geek here please help me clarify ...
"post-text" itemprop = "text">
To list only windows in the taskbar The way (or similarly in the alt-tab box) is described by Raymond in this article on MSDN Blog:
and it is a super function to check whether the window is in the Alt tab Has been shown:
BOOL EASAT TABWANDO (HWND HWD) {TITLEBARINFO ti; Hwd hwdt, hwdwow = null; If (Ivindo Wausible (HWND)) will change wrong; HwndTry = GetAncestor (hwnd, GA_ROOTOWNER); While (hwndTry! = HwndWalk) {hwndWalk = hwndTry; HwndTry = GetLastActivePopup (hwndWalk); If (iSwindOvisable (HWDTE) break); } If (hwndWalk! = Hwnd) return false; // removes ti.cbSize = sizeof (ti) following some work tray program and "program manager"; GetTitleBarInfo (HWD, and TI); If (TI. RGSTET [0] and STATE_SYSTEM_INVISIBLE return FALSE; // Toolbars should not be displayed either, they do not appear in the // taskbar if GetWindowLong (hwnd, GWL_EXSTYLE) and WS_EX_TOOLWINDOW return FALSE; Return TRUE; } The credit given here is in the source code:
Comments
Post a Comment