Marcelo,
Aqui te pongo un ejemplo que deberÃa funcionar bien, pero no lo hace. De todas formas debemos estar muy cerca:
#include "fivewin.ch"
FUNCTION main()
LOCAL oDlg, ofig1, ofig2, s1
DEFINE WINDOW oDlg FROM 10,10 TO 40,60 COLOR "W/G"
SetGridSize( 5, 5 )
@ 15,15 say s1 PROMPT "HOLA" of odlg COLOR CLR_RED SIZE 100,20 DESIGN
s1:lTransparent := .T.
ofig1 := tfig():new(1,1,25,25, oDlg )
ofig2 := tfig():new(25,25,45,55, oDlg )
ACTIVATE WINDOW oDLg
RETURN( NIL )
//----------------------------------------------------------------------------//
CLASS Tfig FROM TControl
CLASSDATA lRegistered AS LOGICAL
METHOD New( nRow, nCol, nHeight, nWidth, oWnd ) CONSTRUCTOR
METHOD Display() INLINE ::BeginPaint(), ::Paint(), ::EndPaint(), 0
METHOD Initiate( hDlg ) INLINE Super:Initiate( hDlg )
METHOD Paint()
METHOD EraseBkGnd() VIRTUAL
ENDCLASS
//----------------------------------------------------------------------------//
METHOD New( nRow, nCol, nHeight, nWidth, oWnd ) CLASS tfig
::nTop := nRow
::nLeft := nCol
::nBottom := ::nTop + nHeight
::nRight := ::nLeft + nWidth
::oWnd := oWnd
::nStyle = nOr( WS_CHILD, WS_VISIBLE, WS_TABSTOP, WS_CLIPSIBLINGS )
::lCaptured := .F.
::lDrag := .T.
::lDesign := .T.
::lUpdate := .T.
::lRegistered := .f.
// ::ltransparent := .T.
::Register()
::Create()
::oWnd:AddControl( Self )
::CheckDots()
return SELF
//----------------------------------------------------------------------------//
METHOD Paint() CLASS tfig
ParentImage( ::hWnd, ::hDC )
moveTo( ::hDC, 1, 1 )
LineTo( ::hDC, ::nWidth, ::nHeight )
return nil
//----------------------------------------------------------------------------//
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
HB_FUNC( PARENTIMAGE ) // hControl, hDC
{
HWND hWnd = ( HWND ) hb_parnl( 1 );
HDC hDC = ( HDC ) hb_parnl( 2 );
HDC hDcParent = GetDCEx( GetParent( hWnd ), NULL, DCX_PARENTCLIP );
RECT rct;
POINT pt;
GetWindowRect( hWnd, &rct );
pt.y = rct.top;
pt.x = rct.left;
ScreenToClient( GetParent( hWnd ), &pt );
BitBlt( hDC, 0, 0, rct.right - rct.left, rct.bottom - rct.top, hDcParent,
pt.x, pt.y, SRCCOPY );
ReleaseDC( GetParent( hWnd ), hDcParent );
}
#pragma ENDDUMP