ユニットUMain;
インタフェース
用途
窓、メッセージ、sysutils、クラス、グラフィック、コントロール、フォーム、ダイアログ、シェラピ、
メニュー、ボタン、extctrls;
const
mousemsg = wm_user + 1;
iid = 100;
タイプ
tform1 = class(tform)
mainmenu1:tmainmenu;
パネル:Tpanel;
SpeedButton1:TspeedButton;
SpeedButton6:TspeedButton;
SpeedButton7:TspeedButton;
SpeedButton8:TspeedButton;
SpeedButton9:TspeedButton;
SpeedButton10:TspeedButton;
popupmenu1:tpopupmenu;
exit1:tmenuitem;
SpeedButton2:TspeedButton;
手順sqllmclick(sender:tobject);
手順n2click(送信者:tobject);
手順speedbutton1click(sender:tobject);
手順formclose(sender:tobject; var action:tcloseaction);
手順formcreate(sender:tobject);
手順Exit1click(sender:tobject);
プライベート
{プライベート宣言}
手順mousemessage(var message:tmessage);メッセージ
Mousemsg;
公共
{公開宣言}
手順exec(送信者:tobject);
終わり;
var
form1:tform1;
ntida:tnotifyicondataa;
実装
{$ r *.dfm}
手順tform1.MouseMessage(var message:tmessage);
var
Mousept:tpoint;
始める
継承;
message.lparam = wm_rbuttonupの場合、開始します
GetCursorpos(MousePt);
popupmenu1.popup(mousept.x、mousept.y);
終わり;
message.lparam = wm_lbuttonupの場合、開始します
showwindow(handle、sw_show);
showwindow(application.handle、sw_show);
SetWindowlong(application.handle、gwl_exstyle、
not(getWindowlong(application.handle、gwl_exstyle)
またはWS_EX_TOOLWINDOWおよびWS_EX_APPWINDOWではない);
終わり;
message.result:= 0;
終わり;
手順tform1.formclose(sender:tobject; var action:tcloseaction);
始める
アクション:= canone;
showwindow(handle、sw_hide);
showwindow(application.handle、sw_hide);
SetWindowlong(application.handle、gwl_exstyle、
not(getWindowlong(application.handle、gwl_exstyle)
またはWS_EX_TOOLWINDOWおよびWS_EX_APPWINDOWではない);
終わり;
手順tform1.formcreate(sender: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:= 'icon';
shell_notifyicona(nim_add、@ntida);
終わり;
手順tform1.exit1click(sender: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:= 'icon';
shell_notifyicona(nim_delete、@ntida);
Application.Terminate;
終わり;
終わり。