وحدة أمين ؛
واجهة
يستخدم
Windows ، الرسائل ، sysutils ، الفئات ، الرسومات ، عناصر التحكم ، النماذج ، الحوار ، Shellapi ،
القوائم ، الأزرار ، extctrls ؛
كونست
mousemsg = wm_user + 1 ؛
IID = 100 ؛
يكتب
tform1 = فئة (tform)
MainMenu1: tmainmenu ؛
لوحة 1: tpanel ؛
Speedbutton1: Tpeedbutton ؛
Speedbutton6: Tpeedbutton ؛
Speedbutton7: tspeedbutton ؛
Speedbutton8: Tpeedbutton ؛
Speedbutton9: tspeedbutton ؛
Speedbutton10: tspeedbutton ؛
popupmenu1: tpopupmenu ؛
Exit1: tmenuitem ؛
Speedbutton2: tspeedbutton ؛
الإجراء sqllmclick (المرسل: tobject) ؛
الإجراء n2click (المرسل: tobject) ؛
الإجراء SpeedButton1click (المرسل: tobject) ؛
الإجراء FormClose (المرسل: TOBJECT ؛ VAR ACTION: TCLOSEACTION) ؛
Formcreate الإجراء (المرسل: TOBJECT) ؛
الإجراءات exit1click (المرسل: tobject) ؛
خاص
{إعلانات خاصة}
الإجراء mousemessage (var message: tmessage) ؛ رسالة
Mousemsg.
عام
{الإعلانات العامة}
الإجراء exec (المرسل: tooject) ؛
نهاية؛
var
Form1: Tform1 ؛
Ntida: tnotifyicondataa ؛
تطبيق
{$ r *.dfm}
الإجراء tform1.mousemessage (رسالة var: tmessage) ؛
var
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: = مقبض ؛
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 ، nntida) ؛
نهاية؛
الإجراء tform1.exit1click (المرسل: tobject) ؛
يبدأ
ntida.cbsize: = sizeof (tnotifyicondataa) ؛
ntida.wnd: = مقبض ؛
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 ، intida) ؛
application.layinate ؛
نهاية؛
نهاية.