Solved

Window class names

Posted on 1997-06-19
2
736 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

895 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now