I have been using this code to try and detect when the static has a dialog in it:
Code:
void CBoxes1Dlg::OnLButtonUp(UINT nFlags, CPoint point)
{
CRect rect;
CWnd *pWnd1;
CPoint pt;
int y=0;
CWnd *pWnd = ChildWindowFromPoint(point);
if(pWnd!=NULL) {
pWnd->GetWindowRect(rect);
ScreenToClient (rect);
pt.x=rect.left+5;
pt.y=rect.top+5;
pWnd1=pWnd->ChildWindowFromPoint(pt,CWP_ALL);
if(pWnd1 == pWnd){
// no dialog in this static box
}else{
// handles don't match so must be a dialog in the static already
}
}
m_person->SetWindowPos(&CWnd::wndTop,(pt.x),(pt.y),0,0,SWP_NOSIZE|SWP_NOZORDER);
}
Anyone see the problem or think of an easier way to do it.
Thanks
Zapper
