Thema: Delphi Taskbareintrag

Einzelnen Beitrag anzeigen

CalganX

Registriert seit: 21. Jul 2002
Ort: Bonn
5.403 Beiträge
 
Turbo Delphi für Win32
 
#2
  Alt 22. Jul 2002, 15:51
So, Problem gelöst...
Für die, die es interessiert der Source:
Code:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, SxTrayIcon;

type
  TForm1 = class(TForm)
    SxTrayIcon1: TSxTrayIcon;
    procedure FormCreate(Sender: TObject);
    procedure toTray(Sender: TObject);
    procedure fromTray(Sender: TObject);
    procedure SxTrayIcon1DblClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.toTray(Sender: TObject);
var Owner: HWND;
begin
  Owner:=GetWindow(Handle,GW_OWNER);
  ShowWindow(Owner,SW_HIDE);
end;

procedure TForm1.fromTray(Sender: TObject);
var Owner: HWND;
begin
  Owner:=GetWindow(Handle,GW_OWNER);
  ShowWindow(Owner,SW_SHOW);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  SxTrayIcon1.Active := true;
  Application.OnMinimize := toTray;
end;

procedure TForm1.SxTrayIcon1DblClick(Sender: TObject);
begin
  fromTray(self);
  Application.Restore;
end;

end.
Ihr braucht aber die Shell+ - Komponenten!

Chris1308
  Mit Zitat antworten Zitat