A ver si damos con la solución, gracias!

Code: Select all | Expand
iParentsWithCaption++; // nuevo !!!
pt.x = rct.left;
pt.y = rct.top;
ScreenToClient( hWndParent, &pt );
rct.left = pt.x + ( iParentsWithCaption * GetSystemMetrics( SM_CXFRAME ) );
rct.top = pt.y + ( iParentsWithCaption * ( GetSystemMetrics( SM_CYCAPTION ) + GetSystemMetrics( SM_CYFRAME ) ) );
Code: Select all | Expand
while( GetParent( hWndParent ) )
{
#ifndef UNICODE
char ClassName[ 100 ];
GetClassName( hWndParent, ClassName, 99 );
if( strcmp( ClassName, "#32770" ) == 0 ) // a Modal Dialog
break;
if( lstrcmp( ClassName, "MDIClient" ) == 0 ) // MDIClient
iParentsWithCaption++;