Solved

Window class names

Posted on 1997-06-19
2
740 Views
Last Modified: 2010-08-05
How do I determine what an application's window class name is.  This is for use with the FindWindow() function.

HWND FindWindow(
    LPCTSTR  lpClassName,      // address of class name
    LPCTSTR  lpWindowName       // address of window name
   );

An example I have shows how to look for WinWord running with the window classname = "OpusApp".  However, I need to look for more than just Word running.  I tried checking the Win95 registry for "OpusApp" to see if this info was stored there, but no luck.

Can someone point me in the right direction.

Thanks,
Jody


0
Comment
Question by:jodyl
[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
2 Comments
 
LVL 1

Accepted Solution

by:
strobert earned 200 total points
ID: 1163988
In spite of what the docs on FindWindow may say, you should be able to call Findwindow with a NULL as the first parameter and a window title as the second, and it will give you back the top-level window with that title.

I have used this method before, so if you know the captions for the programs you are looking for, this should work.  

Otherwise using spy++ from microsoft or winsight from borland will let you see the application's class.
0
 

Author Comment

by:jodyl
ID: 1163989
Spy++ did the trick.  Thanks.

BTW, I needed to know the class name because some apps, such as Word, put the name of the current document in the main window title so I can't always be sure of the title name.

Jody

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

707 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