![]() |
DWM Shadow
Ich hab ne Funktion für DWM Shadow erstellt aber der Schatten wird nicht gezeichnet.
woran liegst? Schatten wird erstellt nach der Anzeige des Window.
Delphi-Quellcode:
WindowStyle
// Window Anzeigen
SKAERO_ShowMainWindow(gp.hMain, 5); SKAERO_EnableShadow(gp.hMain);
Delphi-Quellcode:
dwStyle := WS_POPUP or WS_CLIPSIBLINGS or WS_CLIPCHILDREN;
Delphi-Quellcode:
function DWM_ExtendFrameIntoClientArea(hWnd: hWnd; ATopHeight, ALeftWidth, ABottomHeight,
ARightWidth: Integer): HRESULT; var Margins: TMargins; begin Margins.cyTopHeight := ATopHeight; Margins.cyBottomHeight := ABottomHeight; Margins.cxLeftWidth := ALeftWidth; Margins.cxRightWidth := ARightWidth; Result := S_FALSE; if IsDWMloaded then Result := DwmExtendFrameIntoClientArea(hWnd, @Margins); end;
Delphi-Quellcode:
gruss
function TSkinEngine.EnableShadow(WinHandle: hWnd): HRESULT;
var val: TDWMNCRENDERINGPOLICY; begin Result := -1; if IsCompositionEnabled then begin val := DWMNCRP_ENABLED; DwmSetWindowAttribute(WinHandle, DWMWA_NCRENDERING_POLICY, @val, DWMWA_ALLOW_NCPAINT); Result := DWM_ExtendFrameIntoClientArea(WinHandle, -1, -1, -1, -1); // result := 0 sollte also in Ordnung sein. end; end; |
AW: DWM Shadow
So geht es.
Delphi-Quellcode:
irgendwie erschließt sich das mir nicht.
function TSkinEngine.EnableShadow(WinHandle: hWnd): HRESULT;
var Policy: LongInt; begin Result := -1; if IsCompositionEnabled then begin Policy := DWMNCRP_ENABLED; DwmSetWindowAttribute(WinHandle, DWMWA_NCRENDERING_POLICY, @Policy, SizeOf(Policy)); Result := DWM_ExtendFrameIntoClientArea(WinHandle, -1, -1, -1, -1); end; end; Meiner Meinung nach wäre das richtig.
Delphi-Quellcode:
Dann bekomme ich aber keinen Schatten.
var
Policy: TDWMNCRENDERINGPOLICY; Bei dieser Version gibt es aber auch wieder ein Problem. Sobald ich ein anderes Fenster öffne verschwindet der Schatten von meinem Window. Seltsam das ganze. Auch das ist seltsam funktioniert genauso mit dem vorher genannten Problem
Delphi-Quellcode:
DwmSetWindowAttribute(WinHandle, DWMWA_NCRENDERING_POLICY, @Policy, DWMWA_ALLOW_NCPAINT);
Irgendwie weis keiner was nun richtig übergeben werden muss. Sobald irgendein anderes Fenster aktiviert wird ist der Schatten weg. (Auch das der IDE) gruss |
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:02 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz