หน่วย UMAIN;
ส่วนต่อประสาน
ใช้
Windows, ข้อความ, sysutils, คลาส, กราฟิก, การควบคุม, รูปแบบ, กล่องโต้ตอบ, Shellapi,
เมนู, ปุ่ม, extctrls;
const
mousemsg = wm_user + 1;
IID = 100;
พิมพ์
tform1 = คลาส (tform)
Mainmenu1: tmainmenu;
Panel1: tpanel;
SpeedButton1: TSPEEDBUTTON;
SpeedButton6: TSPEEDBUTTON;
SpeedButton7: TSPEEDBUTTON;
SpeedButton8: TSPEEDBUTTON;
SpeedButton9: TSPEEDBUTTON;
SpeedButton10: TSPEEDBUTTON;
popupmenu1: tpopupmenu;
Exit1: tmenuitem;
SpeedButton2: TSPEEDBUTTON;
ขั้นตอน sqllmclick (ผู้ส่ง: tobject);
ขั้นตอน n2click (ผู้ส่ง: tobject);
ขั้นตอน speedbutton1click (ผู้ส่ง: tobject);
Procedure FormClose (ผู้ส่ง: tobject; การกระทำของ VAR: tcloseaction);
โพรซีเดอร์แบบฟอร์ม (ผู้ส่ง: tobject);
ขั้นตอน EXIT1CLICK (ผู้ส่ง: TOBJECT);
ส่วนตัว
{ประกาศส่วนตัว}
ขั้นตอน mouseMessage (ข้อความ var: tmessage); ข้อความ
Mousemsg;
สาธารณะ
{ประกาศสาธารณะ}
ขั้นตอนการบริหาร (ผู้ส่ง: tobject);
จบ;
วาจา
Form1: TFORM1;
Ntida: tnotifyicondataa;
การดำเนินการ
{$ r *.dfm}
โพรซีเดอร์ tform1.mousemessage (ข้อความ var: tmessage);
วาจา
Mousept: tpoint;
เริ่ม
สืบทอด;
ถ้า message.lparam = wm_rbuttonup แล้วเริ่มต้น
getCursorpos (mousept);
popupmenu1.popup (mousept.x, mousept.y);
จบ;
ถ้า message.lparam = wm_lbuttonup แล้วเริ่มต้น
showwindow (ด้ามจับ, 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: 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: = 'ไอคอน';
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: = 'ไอคอน';
shell_notifyicona (nim_delete, @ntida);
แอปพลิเคชันสิ้นสุด;
จบ;
จบ.