coba yg ini deh:
Uses ShellAPI
....
var
NotifyIconData : TNotifyIconData;
TrayIconData: TNotifyIconData;
...
procedure TForm1.TrayMessage(var Msg: TMessage);
var
CursorPos : TPoint;
begin
case Msg.lParam of
WM_LBUTTONDBLCLK:
begin
Form1.Show;
end;
WM_RBUTTONDOWN:
begin
GetCursorPos(CursorPos);
PopupMenu1.Popup(CursorPos.x, CursorPos.y);
end;
else
inherited;
end;
end;
//form on create
procedure TForm1.FormCreate(Sender: TObject);
begin
with TrayIconData do
begin
cbSize := SizeOf(TrayIconData);
Wnd := Handle;
uID := 0;
uFlags := NIF_MESSAGE + NIF_ICON + NIF_TIP;
uCallbackMessage := WM_USER + 1;
hIcon := Application.Icon.Handle;
StrPCopy(szTip, Application.Title);
end;
Shell_NotifyIcon(NIM_ADD, @TrayIconData);
end;
//show button click
procedure TForm1.Show1Click(Sender: TObject);
begin
Form1.Show;
end;
//hide button click
procedure TForm1.Hide1Click(Sender: TObject);
begin
Form1.Hide;
end;
//hide and minimize kalo di close dari x button (kanan atas)
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caNone;
Hide;
end;
//close beneran
procedure TForm1.Exit1Click(Sender: TObject);
begin
Shell_NotifyIcon(NIM_DELETE, @NotifyIconData);
Application.ProcessMessages;
Application.Terminate;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
Shell_NotifyIcon(NIM_DELETE, @TrayIconData);
end;
----- Original Message -----
From: "�� � Devy � ��" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 05, 2003 9:34 AM
Subject: [Delphindo] Minimize From to System Tray ??
> Saya sedang mencoba membuat sebuah aplikasi yang dijalankan di Server.
> Dan saya ingin agar main form tersebut apabila di minimize oleh user akan
> masuk ke System tray, dan apabila icon di system tray di double klik maka
> main form tersebut akan show secara normal....
>
> saya telah mencari resource nya tapi sampai sekarang belum ketemu..
> Apakah rekan-rekan ada yang bisa membantu saya ??
>
> Regards
> Devy Arifianto
> Golden Truly, IT Dept
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs from home.
Over 14,500 titles. Free Shipping
& No Late Fees. Try Netflix for FREE!
http://us.click.yahoo.com/I3w.vC/hP.FAA/3jkFAA/i7folB/TM
---------------------------------------------------------------------~->
Berlangganan: [EMAIL PROTECTED]
Stop Berlangganan: [EMAIL PROTECTED]
Keluhan Milis(Unbouncing,spam,dll): [EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/