procedure TForm1.IconOnClick(var msg:Tmessage);
var
p : TPoint;
begin
// 如果按下的是鼠标左键,并且允许显示,则显示Form2
if ( (msg.lParam = WM_LBUTTONDOWN) and (Status=True) ) then
Form2.Show;
// 如果按下的是鼠标右键,则显示弹出菜单
if (msg.lParam = WM_RBUTTONDOWN) then
begin
GetCursorPos( p );
PopupMenu1.Popup(p.x ,p.y );
end;
end;
procedure TForm1.AppItemClick(Sender: TObject);
begin
Form2.Show;
showmessage('ok');
end;
procedure TForm1.exitClick(Sender: TObject);
begin
Close;
end;
procedure TForm1.yesornoClick(Sender: TObject);
begin
if(Status=True)then
begin
ChangeIcon( False );
yesorno.Caption:='允许使用(&Y)';
end
else
begin
ChangeIcon( True );
yesorno.Caption:='禁止使用(&D)';
end;
end;