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

x
?
Solved

Find ALL Desktop Window

Posted on 1999-07-30
5
Medium Priority
?
177 Views
Last Modified: 2010-04-02
What should I do when i want to find all windows on Desktop?
find all informations about them.
0
Comment
Question by:hlava
[X]
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
5 Comments
 

Author Comment

by:hlava
ID: 1201411
in C++ Builder compatabile
0
 
LVL 31

Accepted Solution

by:
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,

ZOPPO
0
 

Author Comment

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

Expert Comment

by:Zoppo
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)

ZOPPO
0
 

Author Comment

by:hlava
ID: 1201415
Excelent,Excelent,Excelent,Excelent,Excelent,Excelent,Excelent,Excelent,Excelent,Excelent,Excelent,Excelent,Excelent,Excelent,Excelent,Excelent,Excelent,
That's what I Need and it runs!!!!!!!!!!!!!!
0

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 (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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