unit UMAIN;
antarmuka
penggunaan
Windows, pesan, sysutils, kelas, grafik, kontrol, formulir, dialog, shellapi,
Menu, tombol, extctrls;
const
mousemsg = wm_user + 1;
IID = 100;
jenis
Tform1 = class (tform)
MainMenu1: tmainmenu;
Panel1: tpanel;
Speedbutton1: tspeedbutton;
Speedbutton6: tspeedbutton;
Speedbutton7: tspeedbutton;
Speedbutton8: tspeedbutton;
Speedbutton9: tspeedbutton;
Speedbutton10: tspeedbutton;
Popupmenu1: tpopupmenu;
Exit1: tMenuitem;
Speedbutton2: tspeedbutton;
Prosedur SqllmClick (pengirim: TOBJEK);
Prosedur N2Click (Pengirim: Tobject);
Prosedur SpeedButton1Click (pengirim: Tobject);
Prosedur FormClose (pengirim: Tobject; var Action: tcloseaction);
Prosedur FormCreate (pengirim: Tobject);
PROSEDUR EXIT1Click (pengirim: Tobject);
pribadi
{Deklarasi Pribadi}
Prosedur mouseMessage (pesan var: tmessage); pesan
mousemsg;
publik
{Deklarasi Publik}
Prosedur Exec (pengirim: TOBJEK);
akhir;
var
Form1: tform1;
ntida: tnotifyicondataa;
pelaksanaan
{$ R *.dfm}
Prosedur TFORM1.MOUSEMESSAGE (Pesan VAR: TMessage);
var
mousept: tpoint;
mulai
diwariskan;
Jika pesan.lparam = wm_rbuttonup lalu mulai
getCursorpos (mousept);
popupmenu1.popup (mousept.x, mousept.y);
akhir;
Jika pesan.lparam = wm_lbuttonup lalu mulai
Showwindow (pegangan, sw_show);
Showwindow (application.handle, sw_show);
SetWindowlong (application.handle, gwl_exstyle,
not (getWindowlong (application.handle, gwl_exstyle)
atau ws_ex_toolwindow dan bukan ws_ex_appwindow));
akhir;
Pesan.RESULT: = 0;
akhir;
Prosedur TFORM1.FORMCLOSE (pengirim: Tobject; var Tindakan: tcloseaction);
mulai
Tindakan: = canone;
Showwindow (pegangan, sw_hide);
Showwindow (application.handle, sw_hide);
SetWindowlong (application.handle, gwl_exstyle,
not (getWindowlong (application.handle, gwl_exstyle)
atau ws_ex_toolwindow dan bukan ws_ex_appwindow));
akhir;
Prosedur TFORM1.FORMCREATE (Pengirim: Tobject);
mulai
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: = 'ikon';
shell_notifyicona (nim_add, @ntida);
akhir;
Prosedur TFORM1.EXIT1Click (Pengirim: Tobject);
mulai
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: = 'ikon';
shell_notifyicona (nim_delete, @ntida);
Application.Malter;
akhir;
akhir.