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 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 a application with two main windows and I want to catch events
I have a Windows Service application which uses a Threading.Timer and a TimerCallback to
I have a simple quiz application and I want display a nice timer /
On my application I have a timer that checks for configuration updates from the
I have written a timer application that passes a speechTime from an IBAction and
I have an application that I'm working on that needs to sync a timer
I have a timer in the main application form. The timer displays a nag
I have an application that runs many threads. Each thread should have a timer
I have an game application I have written for Windows Mobile and I want
I would like to have a timer for an ASP.net application that will kick

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.