如何将我的程序放入托盘 如何将我的程序放入托盘 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 送你一个控件,非常管用,我经常用他,不用您写一句代码http://liulangren.xiloo.com/compdown/cooltray4.3.rar 太多了…… 去下一个 CoolTrayIcon 设置几下属性,都不用写代码。 这个可以自己来写程序实现,也可以用控件。Shell_NotifyIcon http://liulangren.xiloo.com/compdown/cooltray4.3.rar我没打开?楼上的,能仔细讲讲吗? unit Unit2;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,ShellAPI, StdCtrls, Menus;const WM_NID=WM_USER+1000;type TForm2 = class(TForm) PopupMenu1: TPopupMenu; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } NotifyIcon:TNotifyIconData; procedure WMNID(var msg:TMessage);message WM_NID; public { Public declarations } end;var Form2: TForm2;implementation{$R *.dfm}procedure TForm2.FormCreate(Sender: TObject);Begin //NotifyIcon为全局变量,在程序的开头已经定义了 with NotifyIcon do begin cbSize:=SizeOf(TNotifyIconData); Wnd:=Handle; //指向当前窗体Form1的句柄 uID:=1; uFlags:=NIF_ICON or NIF_MESSAGE or NIF_TIP; uCallBackMessage:=WM_NID; hIcon:=Application.Icon.Handle; szTip:='张家恶少';end;//把设置好的变量NotifyIcon加入到系统中以便处理 Shell_NotifyIcon(NIM_ADD,@NotifyIcon);End;procedure tform2.WMNID(var msg:TMessage);begin case msg.LParam of WM_LBUTTONUp:Form2.Visible:=not Form2.Visible; //WM_RBUTTONUP: ShowMessage('您点击的是右键'); WM_RBUTTONUP: begin PopupMenu1.Popup(mouse.CursorPos.X,mouse.CursorPos.Y); end; End;End;end. delphi ocx自定义事件 动态创建Tquery对象问题??? rave 报表中如何将delphi中得到的字符串传给rave中的text属性? 如何用ActiveX写Asp服务器端组件? 奇怪问题,在线等待求救!!! RichEdit中如何加上点击可直接打开浏览器上网,(类似IE或者OICQ) 我原来写得程序,当我在打开时为什么会自动关闭delphi 是dbgrid1高手的请进,总共花了我460分。 请指导一二,各位大虾! 查询语句 转成 delphi代码模式 急!!DBGrid中怎样控制在修改了某单元格中的值在失去焦点时写入数据库? 编译问题?
Shell_NotifyIcon
楼上的,能仔细讲讲吗?
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,ShellAPI, StdCtrls, Menus;
const WM_NID=WM_USER+1000;
type
TForm2 = class(TForm)
PopupMenu1: TPopupMenu;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
NotifyIcon:TNotifyIconData;
procedure WMNID(var msg:TMessage);message WM_NID;
public
{ Public declarations }
end;var
Form2: TForm2;implementation{$R *.dfm}procedure TForm2.FormCreate(Sender: TObject);
Begin
//NotifyIcon为全局变量,在程序的开头已经定义了
with NotifyIcon do
begin
cbSize:=SizeOf(TNotifyIconData);
Wnd:=Handle; //指向当前窗体Form1的句柄
uID:=1;
uFlags:=NIF_ICON or NIF_MESSAGE or NIF_TIP;
uCallBackMessage:=WM_NID;
hIcon:=Application.Icon.Handle;
szTip:='张家恶少';
end;
//把设置好的变量NotifyIcon加入到系统中以便处理
Shell_NotifyIcon(NIM_ADD,@NotifyIcon);End;
procedure tform2.WMNID(var msg:TMessage);
begin
case msg.LParam of
WM_LBUTTONUp:Form2.Visible:=not Form2.Visible;
//WM_RBUTTONUP: ShowMessage('您点击的是右键');
WM_RBUTTONUP:
begin
PopupMenu1.Popup(mouse.CursorPos.X,mouse.CursorPos.Y);
end;
End;
End;
end.