我使用了,系统托盘,但最小化时,不能完全最小化到任务蓝,着面的状态蓝还有
解决方案 »
- 如何用代码获得当前窗本的name和caption
- 如何通过程序将SQL Server的一个text字段的内容追加到另外一个text字段中,
- 关于DLL非模式窗体的问题
- 数据导出到EXCEL的问题,把数据库中的一个字段的值"001002005"导出到EXCEL表中后,在EXCEL表中显示为"1002005"了,前面的两个0没了,如何让数
- 怎样把手画出来的线变光滑
- 一个数据库处理的问题,请马上帮忙,急用!
- 哪有拼音输入法的源代码?200分
- 出售程序源代码,感兴趣的进来看看。。。。。。
- 有一个小问题,想请教一下:
- 请教高手,IBTable主从表post的问题,已经试验了几种方式,还是不行,不知道是bug还是程序的问题
- 一个问题,大家来看看。
- 急救啊,DELPHI5安装程序下不下来啊
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,shellapi, Menus;type
TForm1 = class(TForm)
PopupMenu1: TPopupMenu;
N111111111: TMenuItem;
N222221: TMenuItem;
N33331: TMenuItem;
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
procedure wmsyscommand(var msg:Tmessage);message wm_syscommand;
public
{ Public declarations }
procedure instell;
procedure WndProc(var Msg: TMessage); override;
end;const msg_tray=wm_user+1105;
var
Form1: TForm1;
myicon: NotifyIconData;implementation{$R *.dfm}
procedure Tform1.instell;
begin
with myicon do
begin
cbSize:=SizeOf(TNotifyIconData);
Wnd:=Handle; //指向当前窗体Form1的句柄
uID:=0;
uFlags:=NIF_ICON or NIF_MESSAGE or NIF_TIP;
ucallBackMessage:=msg_tray;
hIcon:=Application.Icon.Handle;
szTip:='大家好.....';
end;
Shell_NotifyIcon(NIM_ADD,@myicon);
end;procedure Tform1.wmsyscommand(var msg:Tmessage);
begin
case msg.WParam of
sc_minimize : begin //最小化
Application.Minimize;
form1.Hide;
instell;
inherited;
end;
else
inherited;
end;
end;procedure TForm1.FormDestroy(Sender: TObject);
begin
Shell_NotifyIcon(NIM_DELETE, @myicon);
end;procedure TForm1.WndProc(var Msg: TMessage);
var
pt:TPoint;
begin
with Msg do
begin
if Msg = msg_tray then
begin
case lParam of
WM_RBUTTONDOWN: begin
GetCursorPos(pt);
PopupMenu1.Popup(Pt.X, Pt.Y);
end;
WM_LBUTTONDOWN: begin
form1.Visible:=not form1.Visible;
Shell_NotifyIcon(NIM_DELETE, @myicon);
end; end;
end;
end;
inherited;
end;end.