Finding name/type of CWnd object

I am getting a CWnd * using GetActiveWindow().

I want to forward a message to this CWnd * if it is a certain type of dialog.

How can I go about ascertaining the type/name etc of the CWnd * so I can conditionally post a message to it?

Many thanks for any suggestions.
Attack_TraxAsked:
Who is Participating?
 
alb66Commented:
-----------------------------------------------------------------
First way: use the class type:

CWnd* pWnd = GetActiveWindow();

if ( pWnd->IsKindOf( RUNTIME_CLASS( CYourClass )))
{
   ... do something
}

-----------------------------------------------------------------
Second way: use the title

CWnd* pWnd = GetActiveWindow();

Cstring strTitle;
pWnd->GetWindowText( strTitle )

if ( strTitle == "Your title" )
{
   ... do something
}
0
 
Attack_TraxAuthor Commented:
I had to use IsKindOf() as the Window Text is being used to display status (its a pocket pc app).

Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.