Ich denke ich habs
Delphi-Quellcode:
type TCustomHandleComponent =
class(TComponent)
private
Handle: HWND;
protected
procedure WndProc(
var Msg: TMessage);
virtual;
public
constructor Create(AOwner: TComponent);
override;
destructor Destroy;
override;
published
end;
{ TCustomHandleComponent }
constructor TCustomHandleComponent.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Handle := Classes.AllocateHWnd(WndProc);
end;
destructor TCustomHandleComponent.Destroy;
begin
Classes.DeallocateHWnd(
Handle);
inherited Destroy;
end;
procedure TCustomHandleComponent.WndProc(
var Msg: TMessage);
begin
with Msg
do
if Msg = WM_TIMER
then
try
// NOTHING
except
Application.HandleException(Self);
end
else
Result := DefWindowProc(
Handle, Msg, wParam, lParam);
end;
ich glaub es ist komplett falsch - aber lustigerweiße funktioniert das
thx @ Sprint