如何让我的程序最小化的时候在闪动 当程序最小化时,反复变换icon即可 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 unit fshbx;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, shellapi, Menus, ExtCtrls;const WM_NOTIFYICON = WM_USER + 1;type Tserverfrom = class(TForm) PopupMenu1: TPopupMenu; about1: TMenuItem; exit1: TMenuItem; Timer1: TTimer; procedure exit1Click(Sender: TObject); procedure about1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure Timer1Timer(Sender: TObject); private check: string; Notifydata: Tnotifyicondata; procedure addicon; procedure removeicon; { Private declarations } protected procedure onnotifyicon(var message: TMessage); message WM_NOTIFYICON; public { Public declarations } end;var serverfrom: Tserverfrom;implementation{$R *.DFM}procedure Tserverfrom.addicon;begin notifydata.cbSize := sizeof(notifydata); with notifydata do begin wnd := handle; uid := 1; uflags := NIF_TIP or NIF_ICON or NIF_MESSAGE; hicon := application.Icon.Handle; sztip := '应用服务器'; ucallbackmessage := WM_NOTIFYICON; end; shell_notifyicon(NIM_ADD, @notifydata);end;procedure Tserverfrom.removeicon;begin notifydata.uID := 1; shell_notifyicon(NIM_DELETE, @notifydata);end;procedure Tserverfrom.onnotifyicon(var message: Tmessage);var mousepos: Tpoint;begin if message.lparam = WM_LBUTTONDBLCLK then showmessage('不要乱动!'); if message.lparam = WM_LBUTTONDBLCLK then showmessage('左键双击'); if (message.lparam = WM_RBUTTONDBLCLK) then begin getcursorpos(mousepos); setforegroundwindow(application.handle); application.ProcessMessages; popupmenu1.Popup(mousepos.x, mousepos.y); end;end;procedure Tserverfrom.exit1Click(Sender: TObject);begin removeicon; close;end;procedure Tserverfrom.about1Click(Sender: TObject);begin showmessage('应用服务器');end;procedure Tserverfrom.FormCreate(Sender: TObject);begin addicon; showwindow(application.handle, SW_HIDE); Application.ShowMainForm := False; check :='-255';end;procedure Tserverfrom.FormClose(Sender: TObject; var Action: TCloseAction);begin removeicon;end;procedure Tserverfrom.Timer1Timer(Sender: TObject);begin removeicon; if check = '-255' then begin Application.Icon.LoadFromFile('D:\delphivcl\ico\ico\Funny\grrr!.ico'); check :='0'; end else begin Application.Icon.LoadFromFile('D:\delphivcl\ico\ico\Funny\mr remote.ico'); check :='-255'; end; addicon;end;end. 捕捉最小化时间,加个timer变化图标 TRichEdit的Enabled属性设为false时如何让背景不变灰? MDI子窗口多线程SQL查询没响应 关于界面的问题没多少分了兄弟们帮个忙啊!! 如何获得HTTP地址上某个目录下所有文件(包括子目录)的文件属性。 打印问题 高手帮忙dbgrid问题 在线等待:shellexecute运行起来的程序,如何获取它的进程号? combobox问题 請問如何用Delphi寫SQLServer的擴展存儲過程? ★★★★★★★★★★一个赚20000分的机会★★★★★★★★★★ 怎么查询paradox表中的memo字段? 有关delphi6的treeview的问题,急!!!
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, shellapi,
Menus, ExtCtrls;const WM_NOTIFYICON = WM_USER + 1;
type
Tserverfrom = class(TForm)
PopupMenu1: TPopupMenu;
about1: TMenuItem;
exit1: TMenuItem;
Timer1: TTimer;
procedure exit1Click(Sender: TObject);
procedure about1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Timer1Timer(Sender: TObject);
private
check: string;
Notifydata: Tnotifyicondata;
procedure addicon;
procedure removeicon;
{ Private declarations }
protected
procedure onnotifyicon(var message: TMessage); message WM_NOTIFYICON;
public
{ Public declarations }
end;
var
serverfrom: Tserverfrom;implementation{$R *.DFM}procedure Tserverfrom.addicon;
begin
notifydata.cbSize := sizeof(notifydata);
with notifydata do
begin
wnd := handle;
uid := 1;
uflags := NIF_TIP or NIF_ICON or NIF_MESSAGE;
hicon := application.Icon.Handle;
sztip := '应用服务器';
ucallbackmessage := WM_NOTIFYICON;
end;
shell_notifyicon(NIM_ADD, @notifydata);
end;procedure Tserverfrom.removeicon;
begin
notifydata.uID := 1;
shell_notifyicon(NIM_DELETE, @notifydata);
end;procedure Tserverfrom.onnotifyicon(var message: Tmessage);
var
mousepos: Tpoint;
begin
if message.lparam = WM_LBUTTONDBLCLK then
showmessage('不要乱动!');
if message.lparam = WM_LBUTTONDBLCLK then
showmessage('左键双击');
if (message.lparam = WM_RBUTTONDBLCLK) then
begin
getcursorpos(mousepos);
setforegroundwindow(application.handle);
application.ProcessMessages;
popupmenu1.Popup(mousepos.x, mousepos.y);
end;
end;procedure Tserverfrom.exit1Click(Sender: TObject);
begin
removeicon;
close;
end;procedure Tserverfrom.about1Click(Sender: TObject);
begin
showmessage('应用服务器');
end;procedure Tserverfrom.FormCreate(Sender: TObject);
begin
addicon;
showwindow(application.handle, SW_HIDE);
Application.ShowMainForm := False;
check :='-255';
end;procedure Tserverfrom.FormClose(Sender: TObject; var Action: TCloseAction);
begin
removeicon;
end;procedure Tserverfrom.Timer1Timer(Sender: TObject);
begin
removeicon;
if check = '-255' then
begin
Application.Icon.LoadFromFile('D:\delphivcl\ico\ico\Funny\grrr!.ico');
check :='0';
end
else
begin
Application.Icon.LoadFromFile('D:\delphivcl\ico\ico\Funny\mr remote.ico');
check :='-255';
end;
addicon;
end;end.