寻找托盘程序的源代码,急!!(30分)

  • 主题发起人 主题发起人 程式猎人
  • 开始时间 开始时间

程式猎人

Unregistered / Unconfirmed
GUEST, unregistred user!
用rx控件包的RxTrayIcon吧,很方便的!
 
CoolTrayIcon v2.1.4 FWS 185K 2001-6-1
作者:Troels Jakobsen. 自动将Form缩小为TrayIcon,可设置MinimizeToTrayIcon为True,则Form最小化时不显示在任务栏上。个人认为较RxLib中的RxTrayIcon好用,而且还有源代码哦!

完整功能. 源代码: 有
适用于 D3 D4 D5

http://www.delphibyte.com/download/softdown.php?softid=349&url=http://61.132.118.165/soft/delphi/Delphi3/TTRAYICON.ZIP

可以自己看看它的源码

 
搜索一下吧
很多的
 
unit Utuopan;

interface

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

const
WM_TRAYNOTIFY=2000;
MY_TRAY_ICON=1000;

type
TForm1 = class(TForm)
PopupMenu1: TPopupMenu;
N2: TMenuItem;
procedure N2Click(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
procedure OnMin(Sender: TObject);
procedure WMTrayNotify(var Msg : TMessage);Message WM_TRAYNOTIFY;
end;

var
form1: Tform1;
nid:TNOTIFYICONDATA;


implementation

{$R *.dfm}

procedure TForm1.N2Click(Sender: TObject);
begin
close;
end;



procedure TForm1.FormDestroy(Sender: TObject);
begin
Shell_NotifyIcon(NIM_DELETE,@nid);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMinimize:=OnMin;
end;

procedure Tform1.OnMin(Sender: TObject);
begin
nid.cbSize:=Sizeof(TNOTIFYICONDATA);
nid.Wnd:=Handle;
nid.uID:=MY_TRAY_ICON;
nid.uFlags:=NIF_TIP OR NIF_ICON OR NIF_MESSAGE;
nid.hIcon:=Application.Icon.Handle;
nid.szTip:='我的程序';
nid.uCallbackMessage:=WM_TRAYNOTIFY;
Shell_NotifyIcon(NIM_ADD,@nid);
ShowWindow(Application.Handle,SW_HIDE);
end;

procedure Tform1.WMTrayNotify(var Msg: TMessage);
var
p:TPoint;
begin
if Msg.LParam=WM_LBUTTONDBLCLK then
begin
nid.cbSize:=Sizeof(TNOTIFYICONDATA);
nid.Wnd:=Application.Handle;
nid.uID:=MY_TRAY_ICON;
nid.uFlags:=NIF_TIP OR NIF_ICON OR NIF_MESSAGE;
nid.uCallbackMessage:=WM_TRAYNOTIFY;
nid.szTip:='';
//Shell_NotifyIcon(NIM_ADD,@nid);
ShowWindow(Application.Handle,SW_SHOW);
Application.Restore;
end
else if Msg.LParam=WM_RBUTTONUP then
begin
GetCursorpos(p);
PopupMenu1.Popup (p.x,p.y);
end;
end;

end.
 
多人接受答案了。
 
后退
顶部