Solved

How do I get Class name of CWnd Object ?

Posted on 2000-04-01
3
3,251 Views
Last Modified: 2013-11-20
When an object from another application
is captured, I want to know the objects name.

For example:
Spy++ retirves MSWord Editor class name
as _Wwg.

What is the MFC / API function
that does so ?

Yair


0
Comment
Question by:yairy
  • 2
3 Comments
 
LVL 3

Expert Comment

by:GlennDean
ID: 2676155
Hi yairy:
pWnd->GetRuntimeClass->m_lpszClassName
returns the class name of the object.
   The class does have to use one of the DECLARE_DYNAMIC/DECLARE_SERIAL macros.
   Glenn
0
 
LVL 3

Expert Comment

by:GlennDean
ID: 2676162
DECLARE_DYNCREATE also works.  An example is say I have a class CMyView and in its OnDraw function I write
pDC->TextOut(0,0,GetRuntimeClass->m_lpszClassName);
it spits out
CMyView.
   Glenn  
0
 
LVL 30

Accepted Solution

by:
SteveGTR earned 50 total points
ID: 2676221
This will work:

TCHAR szClassName[255];
if (!::GetClassName(m_hWnd, szClassName, 255))
  ; // Do what you need to do

Good Luck,
Steve
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ORA-01403: no data found 43 83
Complete beginner needs help making a cron job 9 104
sum13 challenge 24 77
no14 challenge 14 57
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

20 Experts available now in Live!

Get 1:1 Help Now