Unit Umain;
interface
usages
Windows, messages, systèmes, classes, graphiques, contrôles, formulaires, dialogues, shellapi,
Menus, boutons, extctrls;
const
MousMsg = WM_USER + 1;
iid = 100;
taper
Tform1 = classe (tform)
MainMenu1: TmainMenu;
Panel1: Tpanel;
SpeedButton1: TspeedButton;
SpeedButton6: TspeedButton;
SpeedButton7: TspeedButton;
SpeedButton8: TspeedButton;
SpeedButton9: TspeedButton;
SpeedButton10: TspeedButton;
PopupMenu1: TpopupMenu;
exit1: tMenuem;
SpeedButton2: TspeedButton;
Procédure sqllmclick (expéditeur: tobject);
procédure n2click (expéditeur: tobject);
Procédure SpeedButton1Click (expéditeur: tobject);
Procédure FormClose (expéditeur: tobject; var action: tcloseAction);
Procédure FormCreate (expéditeur: tobject);
Procédure EXIT1Click (expéditeur: tobject);
privé
{Déclarations privées}
Procédure MouseMessage (message VAR: TMessage); message
Mousmemsg;
publique
{Déclarations publiques}
procédure exec (expéditeur: tobject);
fin;
var
FORM1: TFORM1;
ntida: tnotifyicondataa;
mise en œuvre
{$ R * .dfm}
Procédure TForm1.MousMessage (Message var: TMessage);
var
Mousept: TPoint;
commencer
hérité;
Si message.lparam = wm_rbuttonup alors commencez
getCursorpos (Mousept);
PopupMenu1.popup (Mousept.x, Mousept.Y);
fin;
Si message.lparam = wm_lbuttonup alors commencez
Showwindow (manche, sw_show);
Showwindow (application.handle, sw_show);
Setwindowlong (application.handle, gwl_exstyle,
pas (getwindowlong (application.handle, gwl_exstyle)
ou ws_ex_toolwindow et non ws_ex_appwindow));
fin;
message.result: = 0;
fin;
Procédure tform1.formClose (expéditeur: tobject; var action: tcloseAction);
commencer
Action: = CanOne;
Showwindow (manche, sw_hide);
Showwindow (application.handle, sw_hide);
Setwindowlong (application.handle, gwl_exstyle,
pas (getwindowlong (application.handle, gwl_exstyle)
ou ws_ex_toolwindow et non ws_ex_appwindow));
fin;
Procédure TForm1.FormCreate (Sender: Tobject);
commencer
ntida.cbSize: = sizeof (tnotifyIcondataa);
ntida.wnd: = manche;
ntida.uid: = iid; ntida.uflags: = nif_icon + nif_tip +
NIF_MESSAGE; ntida.ucallbackMessage: = mousmemsg;
ntida.hicon: = application.icon.handle;
ntida.sztip: = 'icon';
shell_notifyicona (nim_add, @ntida);
fin;
Procédure tform1.exit1click (expéditeur: tobject);
commencer
ntida.cbSize: = sizeof (tnotifyIcondataa);
ntida.wnd: = manche;
ntida.uid: = iid;
ntida.uflags: = nif_icon + nif_tip + nif_message;
ntida.ucallbackMessage: = mousmemsg;
ntida.hicon: = application.icon.handle;
ntida.sztip: = 'icon';
shell_notifyicona (nim_delete, @ntida);
Application.terminer;
fin;
fin.