Solved

Window class names

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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.

816 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

13 Experts available now in Live!

Get 1:1 Help Now