Author: Jonas Bilinkevicius
How to give a MDI application a 3D frame
Answer:
You can give an MDI application a 3D frame in Delphi by overriding the main form's
CreateWnd method:
1 procedure TMainForm.CreateWnd;
2 begin3 inherited CreateWnd;
4 SetWindowLong(ClientHandle, GWL_EXSTYLE, GetWindowLong(ClientHandle, GWL_EXSTYLE)
5 or WS_EX_CLIENTEDGE);
6 end;
In the interface section of your main form's unit you have a type definition for
the main form that
looks something like:
7 type8 TMainForm = class(TForm)
9 { maybe some field are defined here }10 private11 { private declarations }12 public13 { public declarations }14 end;
Add the following two lines immediately preceding the end:
protected
procedure CreateWnd; override;
Now add that procedure that I gave you in the implementation section of the unit:
15 procedure TMainForm.CreateWnd;
16 begin17 inherited CreateWnd;
18 SetWindowLong(ClientHandle, GWL_EXSTYLE, GetWindowLong(ClientHandle, GWL_EXSTYLE)
19 or WS_EX_CLIENTEDGE);
20 end;