-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathServiceModule.pas
More file actions
57 lines (45 loc) · 1.18 KB
/
ServiceModule.pas
File metadata and controls
57 lines (45 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
unit ServiceModule;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, SvcMgr, Dialogs,
SysTray;
type
TBellService = class(TService)
SysTrayIcon1: TSysTrayIcon;
procedure SysTrayIcon1LeftDblClick(Sender: TSysTrayIcon; X, Y: Word);
procedure SysTrayIcon1RightClick(Sender: TSysTrayIcon; X, Y: Word);
private
{ Private declarations }
public
function GetServiceController: TServiceController; override;
{ Public declarations }
end;
var
BellService: TBellService;
implementation
{$R *.DFM}
uses MainForm;
procedure ServiceController(CtrlCode: DWord); stdcall;
begin
BellService.Controller(CtrlCode);
end;
function TBellService.GetServiceController: TServiceController;
begin
Result := ServiceController;
end;
procedure TBellService.SysTrayIcon1LeftDblClick(Sender: TSysTrayIcon; X,
Y: Word);
begin
BellSchedule.ShowForm;
end;
procedure TBellService.SysTrayIcon1RightClick(Sender: TSysTrayIcon; X,
Y: Word);
begin
with BellSchedule do
begin
SetForegroundWindow(Handle);
PopupMenu1.Popup(X, Y);
PostMessage(Handle, WM_NULL, 0, 0);
end;
end;
end.