Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Vista Aero Glass Effekt (https://www.delphipraxis.net/88453-vista-aero-glass-effekt.html)

BenjaminH 15. Mär 2007 15:54


Vista Aero Glass Effekt
 
Hallo,
ich versuche nach den Angaben auf dieser Seite den Effekt, dass der Rand eines Formulars durchsichtig ist bei mir in ein Formular einzubauen.
Delphi-Quellcode:
type
  _MARGINS = packed record
    cxLeftWidth: Integer;
    cxRightWidth: Integer;
    cyTopHeight: Integer;
    cyBottomHeight: Integer;
  end;
  PMargins = ^_MARGINS;
  TMargins = _MARGINS;
  TTransparentFormArea=function(destHandle:HWND; Margins:PMargins): HRESULT; stdcall;

var
  hDLL: THandle; // Handle zur DLL
  iRes: integer; // Ergebnis der Funktion
  FarProc: TTransparentFormArea;
  sDLLPath: string;
  Margins:TMargins;
begin
  sDLLPath := 'dwmapi.dll';
  hDLL := LoadLibrary(PChar(sDLLPath));
  if hDLL = 0 then begin
    ShowMessage('DLL konnte nicht geladen werden.');
    Exit;
  end;

  try
    FarProc := GetProcAddress(hDLL, 'DwmExtendFrameIntoClientArea');
    if Assigned(FarProc) then
    Begin
      Margins.cxLeftwidth:=10;
      Margins.cxLeftwidth:=30;
      Margins.cyTopheight:=40;
      Margins.cyBottomheight:=30;
      FarProc(Self.Handle,@Margins);
    End;
  except
    ShowMessage('Funktion der DLL konnte nicht ausgeführt werden.');
  end;
end;
Das Ergebnis ist ziemlich komisch. Bei mir wird der Linke, Rechte und untere Rand(jeweils so Dick wie in Margins beschrieben) weiß. Am Rechten Rand wird eine schwarze Linie(1px) gezeichnet.
Kann das jemand nachvollziehen?

Vielleicht weiß ja auch jemand, was ich falsch gemacht habe?
Vielen Dank..
Benjamin

mkinzler 15. Mär 2007 15:55

Re: Vista Aero Glass Effekt
 
http://www.delphipraxis.net/internal...ct.php?t=89270


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:14 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz