Link to home
Start Free TrialLog in
Avatar of yairy
yairy

asked on

How do I get Class name of CWnd Object ?

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


Avatar of GlennDean
GlennDean

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
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  
ASKER CERTIFIED SOLUTION
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial