forked from chcg/NppQrCode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NppPluginInclude.pas
60 lines (52 loc) · 1.13 KB
/
NppPluginInclude.pas
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
58
59
procedure DLLEntryPoint(dwReason: Integer);
begin
case dwReason of
DLL_PROCESS_ATTACH:
begin
NPlugin := TQrPlugin.Create;
end;
DLL_PROCESS_DETACH:
begin
if (Assigned(NPlugin)) then NPlugin.Destroy;
end;
end;
end;
procedure setInfo(NppData: TNppData); cdecl; export;
begin
NPlugin.SetInfo(NppData);
end;
function getName: nppPchar; cdecl; export;
begin
Result := NPlugin.GetName;
end;
function getFuncsArray(var nFuncs:integer):Pointer;cdecl; export;
begin
Result := NPlugin.GetFuncsArray(nFuncs);
end;
procedure beNotified(sn: PSCNotification); cdecl; export;
begin
NPlugin.BeNotified(sn);
end;
function messageProc(msg: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; cdecl; export;
var
Message:TMessage;
begin
Message.Msg := msg;
Message.WParam := wParam;
Message.LParam := lParam;
Message.Result := 0;
NPlugin.MessageProc(Message);
Result := Message.Result;
end;
{$IFDEF NPPUNICODE}
function isUnicode : Boolean; cdecl; export;
begin
Result := true;
end;
{$ENDIF}
exports
setInfo, getName, getFuncsArray, beNotified, messageProc;
{$IFDEF NPPUNICODE}
exports
isUnicode;
{$ENDIF}