Unit Umain;
인터페이스
용도
Windows, 메시지, sysutils, 클래스, 그래픽, 컨트롤, 양식, 대화, Shellapi,
메뉴, 버튼, extctrls;
Const
mousemsg = wm_user + 1;
iid = 100;
유형
tform1 = 클래스 (tform)
MainMenu1 : tmainmenu;
패널 1 : tpanel;
SpeedButton1 : tspeedbutton;
SpeedButton6 : tspeedbutton;
SpeedButton7 : tspeedbutton;
SpeedButton8 : tspeedbutton;
SpeedButton9 : tspeedbutton;
SpeedButton10 : tspeedbutton;
Popupmenu1 : tpopupmenu;
Exit1 : tmenuitem;
SpeedButton2 : tspeedbutton;
절차 sqllmclick (sender : tobject);
절차 n2click (sender : tobject);
절차 SpeedButton1click (sender : tobject);
절차 formclose (발신자 : tobject; var action : tcloseacect);
프로 시저 Formcreate (sender : tobject);
절차 exit1click (sender : tobject);
사적인
{개인 선언}
절차 Mousemessage (var 메시지 : tmessage); 메시지
mousemsg;
공공의
{공개 선언}
프로 시저 exec (sender : tobject);
끝;
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,
not (getwindowlong (application.handle, gwl_exstyle)
또는 WS_EX_TOOLWINDOW 및 WS_EX_APPWINDOW가 아님);
끝;
메시지 : result : = 0;
끝;
절차 tform1.formclose (Sender : Tobject; var action : tcloseacect);
시작하다
행동 : = canone;
Showwindow (핸들, 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 : = 핸들;
ntida.uid : = iid; ntida.uflags : = nif_icon + nif_tip +
nif_message; ntida.ucallbackmessage : = mousemsg;
ntida.hicon : = application.icon.handle;
ntida.sztip : = '아이콘';
shell_notifyicona (nim_add, @ntida);
끝;
절차 tform1.exit1click (sender : 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 : = '아이콘';
shell_notifyicona (nim_delete, @ntida);
응용 프로그램.
끝;
끝.