Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FindWindow to find popup child windows

Status
Not open for further replies.

Mechy

Programmer
Sep 29, 2003
11
0
0
US
Hi,

I create a child window using the following statements:

m_dChildDlg.Create(IDD_DIALOG_CHILD,this);
m_dChildDlg.ShowWindow(SW_SHOW);

Now I can find handle of the window and close it by using FindWindow command with the following entry:

CWnd* pWnd = CWnd::FindWindow(NULL,"Dialog");
if(pWnd)
{
pWnd->DestroyWindow();
}

But when I change the window to a child style with no border, since the title is not visible, I cannot use this.

The first parameter is the Class name, but how can I use it? Can anybody post a small code? (The class name of the dialog is CChildWin.)
 
this method find only top-level windows. You should fird at the first the parent window and after that use EnumChildWindows to find the child window you need.

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top