mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 11:40:49 +02:00
win32: don't clear WS_CHILD and other unrelated to border style/border icon flags on form handle creation, fix handling of WS_CHILD forms (can be either parent <> nil or ParentWindow <> 0)
git-svn-id: trunk@30046 -
This commit is contained in:
parent
2bd0c336c8
commit
8387ee8302
@ -2255,7 +2255,7 @@ begin
|
||||
Msg := LM_MOVE;
|
||||
// MoveType := WParam; WParam is not defined!
|
||||
MoveType := Move_SourceIsInterface;
|
||||
if (lWinControl is TCustomForm) and (TCustomForm(lWinControl).Parent = nil) then
|
||||
if (lWinControl is TCustomForm) and (GetWindowLong(Window, GWL_STYLE) and WS_CHILD = 0) then
|
||||
begin
|
||||
WindowPlacement.length := SizeOf(WindowPlacement);
|
||||
if IsIconic(Window) and GetWindowPlacement(Window, @WindowPlacement) then
|
||||
|
@ -273,16 +273,16 @@ procedure CalcFormWindowFlags(const AForm: TCustomForm; var Flags, FlagsEx: DWOR
|
||||
var
|
||||
BorderStyle: TFormBorderStyle;
|
||||
begin
|
||||
BorderStyle := GetDesigningBorderStyle(AForm);
|
||||
Flags := BorderStyleToWin32Flags(BorderStyle);
|
||||
if AForm.Parent <> nil then
|
||||
Flags := (Flags or WS_CHILD) and not WS_POPUP;
|
||||
// clear border style flags
|
||||
FlagsEx := FlagsEx and not (WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE or WS_EX_TOOLWINDOW);
|
||||
// clear all styles which can be set by border style and icons
|
||||
Flags := Flags and not (WS_POPUP or WS_BORDER or WS_CAPTION or WS_THICKFRAME or
|
||||
WS_DLGFRAME or WS_MINIMIZEBOX or WS_MAXIMIZEBOX or WS_SYSMENU);
|
||||
FlagsEx := FlagsEx and not (WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE or
|
||||
WS_EX_TOOLWINDOW or WS_EX_CONTEXTHELP);
|
||||
// set border style flags
|
||||
BorderStyle := GetDesigningBorderStyle(AForm);
|
||||
Flags := Flags or BorderStyleToWin32Flags(BorderStyle);
|
||||
FlagsEx := FlagsEx or BorderStyleToWin32FlagsEx(BorderStyle);
|
||||
if (AForm.FormStyle in fsAllStayOnTop) and
|
||||
not (csDesigning in AForm.ComponentState) then
|
||||
if (AForm.FormStyle in fsAllStayOnTop) and not (csDesigning in AForm.ComponentState) then
|
||||
FlagsEx := FlagsEx or WS_EX_TOPMOST;
|
||||
Flags := Flags or CalcBorderIconsFlags(AForm);
|
||||
FlagsEx := FlagsEx or CalcBorderIconsFlagsEx(AForm);
|
||||
|
Loading…
Reference in New Issue
Block a user