Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Find ALL Desktop Window

Posted on 1999-07-30
Medium Priority
Last Modified: 2010-04-02
What should I do when i want to find all windows on Desktop?
find all informations about them.
Question by:hlava
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Author Comment

ID: 1201411
in C++ Builder compatabile
LVL 31

Accepted Solution

Zoppo earned 400 total points
ID: 1201412
Hi hlava,

Use API function EnumWindows() and write your custom EnumWindowsProc() function to get infos about all top level windows.

hope that helps,


Author Comment

ID: 1201413
could you write an example of use?
LVL 31

Expert Comment

ID: 1201414
BOOL CALLBACK MyWindowsProc( HWND hwnd, LPARAM lParam )
 // with hwnd you can do here what you want to do to get information about a toplevel window
 // you can also implement a call to EnumChildWindows() to get information about all childs

 BOOL ret = TRUE;
 // you can set ret to FALSE if you want to stop enumeration of the windows
 return ret;

void GetWindowsInfo()
 void* ptr = NULL;
 // you can use this pointer to pass any values to the MyEnumWindowsProc()
 if ( !EnumWindows( (WNDENUMPROC)MyEnumWindowsProc, ptr ) )
  TRACE("Error %i occured while EnumWindows()\n", GetLastError() );

hope that works   :o)


Author Comment

ID: 1201415
That's what I Need and it runs!!!!!!!!!!!!!!

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question