Umain单位;
界面
用途
Windows,消息,Sysutils,类,图形,控件,表单,对话框,Shassapi,
菜单,按钮,extctrls;
const
mousemsg = wm_user + 1;
IID = 100;
类型
tform1 = class(tform)
mainmenu1:tmainmenu;
面板1:tpanel;
SpeedButton1:tspeedButton;
SpeedButton6:tspeedButton;
SpeedButton7:TspeedButton;
SpeedButton8:tspeedButton;
SpeedButton9:TspeedButton;
SpeedButton10:tspeedButton;
popupmenu1:tpopupmenu;
退出1:tmenuitem;
SpeedButton2:tspeedButton;
过程SQLLMCLICK(发件人:tobject);
过程N2Click(发送者:tobject);
过程SpeedButton1Click(发件人:tobject);
过程表格close(发件人:tobject; var Action:tcloseaction);
过程FormCreate(发送者:tobject);
Procedure Exit1Click(发件人:tobject);
私人的
{私人声明}
过程Mousemessage(var消息:tmessage);信息
Mousemsg;
民众
{公开声明}
过程exec(发件人:tobject);
结尾;
var
form1:tform1;
ntida:tnotifyicondataa;
执行
{$ r *.dfm}
过程tform1.mousemessage(var消息:tmessage);
var
Mousept:TPoint;
开始
遗传;
如果messages.lparam = wm_rbuttonup,然后开始
GetCursorPos(Mousept);
popupmenu1.popup(Mousept.x,Mousept.y);
结尾;
如果messages.lparam = wm_lbuttonup,然后开始
ShowWindow(handle,sw_show);
ShowWindow(application.handle,sw_show);
setWindowlong(application.handle,gwl_exstyle,
没有(getWindowlong(application.handle,gwl_exstyle)
或WS_EX_ToolWindow,而不是WS_EX_APPWINDOW));
结尾;
message.result:= 0;
结尾;
过程tform1.formclose(发件人:tobject; var Action:tcloseaction);
开始
动作:= canone;
ShowWindow(句柄,sw_hide);
ShowWindow(application.handle,sw_hide);
setWindowlong(application.handle,gwl_exstyle,
没有(getWindowlong(application.handle,gwl_exstyle)
或WS_EX_ToolWindow,而不是WS_EX_APPWINDOW));
结尾;
过程tform1.formCreate(发件人:tobject);
开始
ntida.cbsize:= sizeof(tnotifyicondataa);
ntida.wnd:= handle;
ntida.uid:= iid; ntida.uflags:= nif_icon + nif_tip +
nif_message; ntida.ucallbackmessage:= mousemsg;
ntida.hicon:= application.icon.handle;
ntida.sztip:='iCon';
shell_notifyicona(nim_add,@ntida);
结尾;
过程tform1.exit1Click(发送者:tobject);
开始
ntida.cbsize:= sizeof(tnotifyicondataa);
ntida.wnd:= handle;
ntida.uid:= iid;
ntida.uflags:= nif_icon + nif_tip + nif_message;
ntida.ucallbackmessage:= mousemsg;
ntida.hicon:= application.icon.handle;
ntida.sztip:='iCon';
shell_notifyicona(nim_delete,@ntida);
application.terminate;
结尾;
结尾。