Delphi MDI app and MDI Children header

I have an MDI application written in Delphi 2006 that runs XP with a default theme.

Is there a way to control the appearance of MDI children in order to avoid the large XP header in each window?

I tried setting BorderStyleto MDIChildrenon bsSizeToolWin, but they still appear as normal forms.

+3
source share
4 answers

All your need is the CreateWindowHandle overload procedure, for example:

unit CHILDWIN;
interface
uses Windows, Classes, Graphics, Forms, Controls, StdCtrls;

type
  TMDIChild = class(TForm)
  private
    { Private declarations }
  public
    { Public declarations }
    procedure CreateWindowHandle(const Params: TCreateParams); override;
  end;

implementation

{$R *.dfm}
procedure TMDIChild.CreateWindowHandle(const Params: TCreateParams);
begin
  inherited CreateWindowHandle(Params);
  SetWindowLong(Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
end;
end.
+4
source

How MDI works, not a gel with what you are trying to do.

MDI, - , MDI.

Delphi TFrames , . Outlook. :

TMyForm = class(TForm)
private
  FCurrentModule : TFrame;
public
  property CurrentModule : TFrame read FModule write SetCurrentModule;
end;

procedure TMyForm.SetCurrentModule(ACurrentModule : TFrame);
begin
  if assigned(FCurrentModule) then
    FreeAndNil(FCurrentModule);  // You could cache this if you wanted
  FCurrentModule := ACurrentModule;
  if assigned(FCurrentModule) then
  begin
    FCurrentModule.Parent := Self;
    FCurrentModule.Align := alClient;
  end;
end;

, :

MyForm.CurrentModule := TSomeFrame.Create(nil);

, ( IModule - ), . , , , .

+1

, ; , MDI Delphi VCL (, , Windows API?). , MDI- ( , , API, ) MDI- .

, , , ? , , MDI --- :)

(PS: Delphi !)

0

onnodb

, MDI .

I developed one way to do this, to hide the title bar by overriding the CreateParams windows, and then create my own title bar (a simple panel with some mouse processing to move). It works quite well, so I think I can run it as a client and see if it will do this ...

0
source

Source: https://habr.com/ru/post/1696399/


All Articles