Solved

Window class names

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

760 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

22 Experts available now in Live!

Get 1:1 Help Now