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;
結尾;
結尾。