Link to home
Start Free TrialLog in
Avatar of ms99
ms99

asked on

Points for ptmcomp: Why setClassLong isn't working

Hi, ptmComp. Please post the same answer you gave to my othe question and I'll give you the points.

In Delphi 5 I'm using setClassLong to replace the window class background brush but it's not working. I tried with a solid brush and a bitmap brush.

var
brushBackGround : HBrush;
bm:graphics.tbitmap;
begin
bm := graphics.TBitmap.create;
try
bm.loadFromFile('patron1.bmp');
// brushBackGround := createPatternBrush(bm.handle);
brushBackGround := createSolidBrush(clRed);
setClassLong(application.handle,GCL_HBrBackGround,brushBackGround);
try
Application.Initialize;
Application.CreateForm(TForm1, Form1); // form1 is an empty form
// setClassLong(form1.handle,GCL_HBrBackGround,brushBackGround); tried this, didn't work neither
Application.Run;
finally
deleteObject(brushBackGround);
end;
finally
bm.Free;
end;
end.

ASKER CERTIFIED SOLUTION
Avatar of ptmcomp
ptmcomp
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial