win32: fix showing an alphablend parented form on win 7 and older. issue #26206, patch from Michl

git-svn-id: trunk@53436 -
This commit is contained in:
ondrej 2016-11-24 15:47:57 +00:00
parent 83086f564a
commit 96834c85ee

View File

@ -206,6 +206,12 @@ begin
end;
end;
// mantis #26206: Layered windows are only supported for top-level windows.
// After Windows 8 it is supported for child windows too.
if (WindowsVersion < wv8) and Assigned(AWinControl.Parent)
and (AWinControl is TCustomForm) and TCustomForm(AWinControl).AlphaBlend then
FlagsEx := FlagsEx and not WS_EX_LAYERED;
Window := CreateWindowExW(FlagsEx, PWideChar(WideString(pClassName)),
PWideChar(UTF8ToUTF16(WindowTitle)), Flags,
Left, Top, Width, Height, Parent, 0, HInstance, @NCCreateParams);