Taavi,
I use a funtion, to paint different backgrounds ( Windows or Dialog )
c_path := cFilePath(GetModuleFileName( GetInstance() ) ) // Main-directory
c_path1 := c_path + "IMAGES\" // selected image-directory in function
...
...
// defined values for colors and brushes
// --------------------------------------------
nWStyle := 1 // 1 = Color, 2 = Gradient, 3 = BMP-brush, 4 = Image
nWColorF := 16443068
nWColorB := 10899511
nWGradPos := 0.2
lWDirect := .T. // Vertical
cWBrush := "Brick.Bmp"
WImage := "Logo.Jpg"
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT WD_BACKGRD( oWnd, nWStyle, lWDirect, nWColorF, nWColorB, nWGradPos, cWBrush, cWImage )
...
// or use to paint a Image-background :
// ON INIT WD_BACKGRD( oWnd, 4, , , , , , "Logo.Jpg" )
// -------- Â WINDOW / DIALOG - Background ---------------
FUNCTION WD_BACKGRD( oDlg, nStyle, lDirect, nColor1, nColor2, nMove, cBrush, cImage )
local oBrush, oImage
local aRect := GETCLIENTRECT( oDlg:hWnd )
IF nStyle = 1 // COLOR
  DEFINE BRUSH oBrush COLOR nColor1
ENDIF
IF nStyle = 2 // GRADIENT Brush
  aGrad := { { nMove, nColor1, nColor2 }, { nMove, nColor2, nColor1 } }
  DEFINE BRUSH oBrush GRADIENT aGrad ;
  STYLE ( If( lDirect = .T., "VERTICAL", "HORIZONTAL" ) )
ENDIF
IF nStyle = 3 // BMP-BRUSH
  DEFINE BRUSH oBrush FILE c_path1 + cBrush
ENDIF
IF nStyle = 4 // Image ADJUSTED
  DEFINE IMAGE oImage FILE c_path1 + cImage
  oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, aRect[4], aRect[3], .T. ) )
  oImage:End()
ENDIF
oDlg:SetBrush( oBrush )
oBrush:End()
RETURN( NIL )
Best Regards
Uwe
