unidade umain;
interface
usos
Janelas, mensagens, sysutils, classes, gráficos, controles, formulários, diálogos, shellapi,
Menus, botões, extctrls;
const
mouseMSG = wm_user + 1;
iid = 100;
tipo
Tform1 = classe (tform)
MAINMENU1: TMAINMENU;
Painel1: tpanel;
Speedbutton1: TspeedButton;
Speedbutton6: TspeedButton;
Speedbutton7: TspeedButton;
Speedbutton8: TspeedButton;
Speedbutton9: TspeedButton;
Speedbutton10: TspeedButton;
PopupMenu1: tpopupmenu;
Exit1: tmenuitem;
Speedbutton2: TspeedButton;
Procedimento sqllmClick (remetente: tabjas);
Procedimento N2Click (remetente: Tobject);
Procedimento Speedbutton1Click (remetente: Tobject);
Procedimento FormClose (remetente: TOBJECT; VAR Action: TCLOSEACTION);
Procedimento FormCreate (remetente: Tobject);
Procedimento Exit1Click (remetente: Tobject);
privado
{Declarações privadas}
procedimento mouseMessage (VAR Mensagem: tMessage); mensagem
mouseMSG;
público
{Declarações públicas}
Procedimento EXEC (remetente: Tobject);
fim;
var
Form1: TForm1;
ntida: tnotifyicondataa;
implementação
{$ R *.dfm}
procedimento TForm1.Mousemessage (VAR Mensagem: TMessage);
var
Mousept: TPoint;
começar
herdado;
se message.lparam = wm_rbuttonup então comece
getCursorPos (mousept);
popupMenu1.popup (mousept.x, mousept.y);
fim;
se message.lparam = wm_lbuttonup então comece
ShowWindow (Handle, SW_Show);
ShowWindow (Application.Handle, SW_Show);
SetWindowlong (Application.Handle, gwl_exstyle,
não (getwindowlong (Application.handle, gwl_exstyle)
ou ws_ex_toolwindow e não ws_ex_appwindow));
fim;
message.Result: = 0;
fim;
Procedimento TForm1.FormClose (remetente: TOBJECT; VAR Action: TCLOSEACTION);
começar
Ação: = CANONE;
ShowWindow (Handle, SW_HIDE);
ShowWindow (Application.Handle, SW_HIDE);
SetWindowlong (Application.Handle, gwl_exstyle,
não (getwindowlong (Application.handle, gwl_exstyle)
ou ws_ex_toolwindow e não ws_ex_appwindow));
fim;
procedimento TForm1.FormCreate (remetente: Tobject);
começar
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);
fim;
procedimento TFFORM1.EXIT1CLICK (remetente: Tobject);
começar
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.Merminate;
fim;
fim.