Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6474343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:34:35+00:00 2026-05-25T06:34:35+00:00

In VC++, I use EnumWindows(…), GetWindow(…), and GetWindowLong(), to get the list of windows

  • 0

In VC++, I use EnumWindows(…), GetWindow(…), and GetWindowLong(), to get the list of windows and check whether the window is top window (no other window as owner), and whether the window is visible (WS_VISIBLE). However, although my desktop is showing only 5 windows, this EnumWindows is giving me 50 windows, how funny! Any Windows geek here please help me clarify…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:34:35+00:00Added an answer on May 25, 2026 at 6:34 am

    The way to list out only windows in taskbar (or similarly in Alt-Tab box) is described by Raymond in this article on MSDN blog:

    Which windows appear in the Alt+Tab list?

    And this is the super function to check whether a window is shown in alt-tab:

    BOOL IsAltTabWindow(HWND hwnd)
    {
        TITLEBARINFO ti;
        HWND hwndTry, hwndWalk = NULL;
    
        if(!IsWindowVisible(hwnd))
            return FALSE;
    
        hwndTry = GetAncestor(hwnd, GA_ROOTOWNER);
        while(hwndTry != hwndWalk) 
        {
            hwndWalk = hwndTry;
            hwndTry = GetLastActivePopup(hwndWalk);
            if(IsWindowVisible(hwndTry)) 
                break;
        }
        if(hwndWalk != hwnd)
            return FALSE;
    
        // the following removes some task tray programs and "Program Manager"
        ti.cbSize = sizeof(ti);
        GetTitleBarInfo(hwnd, &ti);
        if(ti.rgstate[0] & STATE_SYSTEM_INVISIBLE)
            return FALSE;
    
        // Tool windows should not be displayed either, these do not appear in the
        // task bar.
        if(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW)
            return FALSE;
    
        return TRUE;
    }
    

    Credited to the source code here:
    http://www.dfcd.net/projects/switcher/switcher.c

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use this function EnumWindows(EnumWindowsProc, NULL);. The EnumWindowsProc is a Callback function:
use Modern::Perl; use Algorithm::Permute; use List::AllUtils qw/uniq/; find_perms(1151); sub find_perms { my ($value) =
I am trying to use MFC with visual Studio 2012 on Windows 8. I
use javascript or other method ? have any recommendation?
Use case: You have 2-3 files displayed in your MacVim window(s). You press ctrl+Q
Use OPENXML to get dt element in MSSQL 2005. How can I get xmlns:dt
Use case: User clicks a link, a modal window is displayed containing one big
From a couple of preliminary tests it seems that EnumWindows always returns windows in
with python, I want to get a window title,a stock software window. the window's
use Mojolicious::Lite; # /with_layout get '/a' => sub { my $self = shift;} ;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.