I'm using this code to remove the vcl styles from the non client area of a form.
type
TFormStyleHookNC= class(TMouseTrackControlStyleHook)
protected
procedure PaintBackground(Canvas: TCanvas); override;
constructor Create(AControl: TWinControl); override;
end;
constructor TFormStyleHookNC.Create(AControl: TWinControl);
begin
inherited;
OverrideEraseBkgnd := True;
end;
procedure TFormStyleHookNC.PaintBackground(Canvas: TCanvas);
var
Details: TThemedElementDetails;
R: TRect;
begin
if StyleServices.Available then
begin
Details.Element := teWindow;
Details.Part := 0;
R := Rect(0, 0, Control.ClientWidth, Control.ClientHeight);
StyleServices.DrawElement(Canvas.Handle, Details, R);
end;
end;
initialization
TStyleManager.Engine.RegisterStyleHook(TForm3, TFormStyleHookNC);
Before to apply this style hook the form looks like
and after
As you can see the menu disappears, The question is : how I can fix this? I mean how i can remove the vcl styles from the non client area of a form without remove the TMainMenu?