by mastintin » Wed May 22, 2013 8:34 pm
Os dejo esta "mejora" para que msglogo acepte archivos jpg y png incrustados en los recursos del programa
- Code: Select all Expand view RUN
function MsgLogo( cBmpResource, nSeconds )
local oDlg, oBmp
if ! Empty( cBmpResource )
cBmpResource = AllTrim( cBmpResource )
endif
DEFINE DIALOG oDlg FROM 10, 10 TO 14, 14 ;
STYLE nOr( DS_SYSMODAL, WS_POPUP )
if File( cBmpResource )
if Upper( cFileExt( cBmpResource ) ) == "BMP"
@ 0, 0 BITMAP oBmp FILENAME cBmpResource OF oDlg
else
@ 0, 0 IMAGE oBmp FILENAME cBmpResource OF oDlg
oBmp:Progress( .f. )
endif
else
IF FindResource( GetResources(), cBmpResource , 10 ) != 0
@ 0, 0 BITMAP oBmp OF oDlg
obmp:hBitmap := FILoadFromMemory( cResToStr( cBmpResource, 10 ), 10 )
else
if Upper( cFileExt( cBmpResource ) ) == "BMP"
@ 0, 0 BITMAP oBmp RESOURCE cBmpResource OF oDlg
else
pausa(3)
@ 0, 0 IMAGE oBmp RESOURCE cBmpResource OF oDlg
oBmp:Progress( .f. )
endif
endif
endif
oBmp:blClicked := {|| oDlg:End() }
if ! Empty( oBmp:hBitmap )
pausa(5)
ACTIVATE DIALOG oDlg NOWAIT ;
ON INIT ( oBmp:Move( 0, 0, oBmp:nWidth() + 2, oBmp:nHeight() + 2 ),;
oDlg:Move( 0, 0, oBmp:nWidth() + 2, oBmp:nHeight() + 2 ),;
WndCenter( oDlg:hWnd ),;
If( nSeconds != 0, LogoTimer( oDlg, nSeconds ), nil ) )
UpdateWindow( oDlg:hWnd )
endif
return oDlg