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

  • Home
  • SEARCH
  • 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 947425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:04:50+00:00 2026-05-15T23:04:50+00:00

in my application i have timer, in TimerProc i want to get handles of

  • 0

in my application i have timer, in TimerProc i want to get handles of all windows(main and child) of the another application that has focus. I have no idea how to do that because i don’t understand functions like GetNextWindow or GetParent and Z-oder of windows and i can’t find anywhere very detailed explanation of how this functions works(i dont understand explanation on msdn). Please can you give me some advice or block of code which do that? Many thanks for answer.

  • 1 1 Answer
  • 1 View
  • 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-15T23:04:51+00:00Added an answer on May 15, 2026 at 11:04 pm

    Use GetForegroundWindow() function – it returns the HWND of the window the user currently is working with.
    Then having this handle you can retrieve childs in such a way:

     HWND a_hWnd = (HWND)hParent;
      HWND a_FirstChild = NULL;
      a_FirstChild = ::GetWindow(a_hWnd, GW_CHILD);
    
      if (a_FirstChild != NULL)
      {
    
        HWND a_NextChild = NULL;
        do
        {
          a_NextChild = ::GetWindow(a_FirstChild, GW_HWNDNEXT);
          if (a_NextChild != NULL)
          {
            a_FirstChild = a_NextChild;
          }
        }
        while (a_NextChild != NULL);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an game application I have written for Windows Mobile and I want
On my application I have a timer that checks for configuration updates from the
I have a control application - using asp.net webservices. I have a timer which
I have C# winforms application that needs to start an external exe from time
I have a web application that currently sends emails. At the time my web
I have an application that consists of a WPF UI with an infrastructure layer
In my application I have a loop that in each turn creates an instance
I have a MATLAB GUI and a separate application that writes data to a
Here's the deal: I have an Android application that needs to call a web
I have a three-tier application which is installed in corporate environments. With every server

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.