Okay, hatte ich mir schon gedacht, dass das so läuft

Danke dir!
Lade den Source später mal hoch..
Hab im moment wiedermal ein problem beim Freigeben der Classe
mal gehts mal nicht
To many error in Free

Obwohl alles korrekt freigegeben wird.
Wüßte nicht was da falsch sein sollte.
Delphi-Quellcode:
type
TFadeWnd = class(TComponent)
private
{ Private-Deklarationen }
procedure AutoFade(pParentWnd: TWinControl; clLight: COLORREF;
clDark: COLORREF); stdcall;
procedure CreateGradient(clLight: COLORREF;
clDark: COLORREF); virtual;
procedure FadeWnd(pParentWnd: TWinControl; clLight: COLORREF;
clDark: COLORREF); stdcall;
public
function GetDibR(const drgb: cardinal): cardinal; inline;
function GetDibG(const drgb: cardinal): cardinal; inline;
function GetDibB(const drgb: cardinal): cardinal; inline;
function Create(pParentWnd: TWinControl; rc: TRect): Bool; reintroduce; overload;
constructor Create(AOwner: TWinControl); reintroduce; overload;
destructor Destroy; override;
protected
m_clGradient: array [0..255] of COLORREF;
m_hBitmap: HBITMAP;
m_hNewBitmap: HBITMAP;
m_pWndLock: TWinControl;
procedure OnDraw(pDC: HDC);
function CopyScreenToBitmap(lpRect: TRect): HBITMAP;
function FadeBitmap(hBmp: HBITMAP; dfTrans: double = 100.0; hBmpDC: HDC = 0): HBITMAP;
end;
var
pFade: TFadeWnd;
MainHandle: HWND;
Pixels: array of Cardinal;
// Exports
function FadeCreate(pParentWnd: TWinControl;clLight: COLORREF;
clDark: COLORREF): Bool; stdcall;
procedure FadeDestroy; stdcall;
Delphi-Quellcode:
procedure FadeDestroy; stdcall;
begin
if Assigned(pFade) then
begin
DestroyWindow(MainHandle);
pFade.Free;
pFade := nil;
end;
end;
gruss