summaryrefslogtreecommitdiff
path: root/include/delphi/testdll.dpr
diff options
context:
space:
mode:
authorAlexey Kulakov <panda75@bk.ru>2012-07-04 20:10:29 +0000
committerAlexey Kulakov <panda75@bk.ru>2012-07-04 20:10:29 +0000
commit65e002b63efdb00571d0ba4ec1a73b14e1d7d3a0 (patch)
treed96b2f52ca3c89172f269cdb172c89cf6141d69c /include/delphi/testdll.dpr
parentd7f143dba9e53347a1d7897bcd3989751c7f45f8 (diff)
Pascal headers moved to include\delphi directory (with small updates)
removed deprecated m_mwclc.h file and link on it in AutoShutdown plugin git-svn-id: http://svn.miranda-ng.org/main/trunk@763 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/delphi/testdll.dpr')
-rw-r--r--include/delphi/testdll.dpr125
1 files changed, 72 insertions, 53 deletions
diff --git a/include/delphi/testdll.dpr b/include/delphi/testdll.dpr
index 478212d82c..f30da207ec 100644
--- a/include/delphi/testdll.dpr
+++ b/include/delphi/testdll.dpr
@@ -1,60 +1,79 @@
library testdll;
uses
+ m_api, Windows;
- m_globaldefs, m_api, Windows;
-
- {$include m_helpers.inc}
-
- function MirandaPluginInfo(mirandaVersion: DWORD): PPLUGININFO; cdecl;
- begin
- Result := @PLUGININFO;
- PLUGININFO.cbSize := sizeof(TPLUGININFO);
- PLUGININFO.shortName := 'Plugin Template';
- PLUGININFO.version := PLUGIN_MAKE_VERSION(0,0,0,1);
- PLUGININFO.description := 'The long description of your plugin, to go in the plugin options dialog';
- PLUGININFO.author := 'J. Random Hacker';
- PLUGININFO.authorEmail := 'noreply@sourceforge.net';
- PLUGININFO.copyright := '(c) 2003 J. Random Hacker';
- PLUGININFO.homepage := 'http://miranda-icq.sourceforge.net/';
- PLUGININFO.isTransient := 0;
- PLUGININFO.replacesDefaultModule := 0;
- end;
-
- function PluginMenuCommand(wParam: WPARAM; lParam: LPARAM): Integer; cdecl;
- begin
- Result := 0;
- // this is called by Miranda, thus has to use the cdecl calling convention
- // all services and hooks need this.
- MessageBox(0, 'Just groovy, baby!', 'Plugin-o-rama', MB_OK);
- end;
-
- function Load(link: PPLUGINLINK): int; cdecl;
- var
- mi: TCListMenuItem;
- begin
- // this line is VERY VERY important, if it's not present, expect crashes.
- PLUGINLINK := Pointer(link);
- pluginLink^.CreateServiceFunction('TestPlug/MenuCommand', @PluginMenuCommand);
- FillChar(mi, sizeof(mi), 0);
- mi.cbSize := sizeof(mi);
- mi.position := $7FFFFFFF;
- mi.flags := 0;
- mi.hIcon := LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
- mi.pszName := '&Test Plugin...';
- mi.pszService := 'TestPlug/MenuCommand';
- pluginLink^.CallService(MS_CLIST_ADDMAINMENUITEM, 0, lParam(@mi));
- Result := 0;
- end;
-
- function Unload: int; cdecl;
- begin
- Result := 0;
- end;
-
- exports
-
- MirandaPluginInfo, Load, Unload;
+var
+ PluginInterfaces:array [0..1] of MUUID;
+
+function MirandaPluginInfoEx(mirandaVersion:DWORD):PPLUGININFOEX; cdecl;
+begin
+ result:=@PluginInfo;
+ PluginInfo.cbSize :=SizeOf(TPLUGININFOEX);
+ PluginInfo.shortName :='Plugin Template';
+ PluginInfo.version :=$00000001;
+ PluginInfo.description:='The long description of your plugin, to go in the plugin options dialog';
+ PluginInfo.author :='J. Random Hacker';
+ PluginInfo.authorEmail:='noreply@sourceforge.net';
+ PluginInfo.copyright :='(c) 2003 J. Random Hacker';
+ PluginInfo.homepage :='http://miranda-icq.sourceforge.net/';
+ PluginInfo.flags :=UNICODE_AWARE;
+ PluginInfo.replacesDefaultModule:=0;
+ PluginInfo.uuid :=MIID_TESTPLUGIN;//'{08B86253-EC6E-4d09-B7A9-64ACDF0627B8}';
+end;
+
+function PluginMenuCommand(wParam: WPARAM; lParam: LPARAM):int_ptr; cdecl;
+begin
+ Result:=0;
+ // this is called by Miranda, thus has to use the cdecl calling convention
+ // all services and hooks need this.
+ MessageBox(0, 'Just groovy, baby!', 'Plugin-o-rama', MB_OK);
+end;
+
+var
+ onloadhook:THANDLE;
+
+function OnModulesLoaded(wParam:WPARAM;lParam:LPARAM):int;cdecl;
+var
+ mi:TCListMenuItem;
+begin
+ Result:=0;
+ UnhookEvent(onloadhook);
+
+ CreateServiceFunction('TestPlug/MenuCommand', @PluginMenuCommand);
+ FillChar(mi,SizeOf(mi),0);
+ mi.cbSize :=SizeOf(mi);
+ mi.position :=$7FFFFFFF;
+ mi.flags :=0;
+ mi.hIcon :=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ mi.szName.a :='&Test Plugin...';
+ mi.pszService:='TestPlug/MenuCommand';
+ Menu_AddMainMenuItem(@mi)
+end;
+
+function Load():int; cdecl;
+begin
+ Langpack_register;
+ onloadhook:=HookEvent(ME_SYSTEM_MODULESLOADED,@OnModulesLoaded);
+
+ Result:=0;
+end;
+
+function Unload:int; cdecl;
+begin
+ Result:=0;
+end;
+
+function MirandaPluginInterfaces:PMUUID; cdecl;
+begin
+ PluginInterfaces[0]:=MIID_TESTPLUGIN;
+ PluginInterfaces[1]:=MIID_LAST;
+ result:=@PluginInterfaces;
+end;
+
+exports
+ Load, Unload,
+ MirandaPluginInterfaces,MirandaPluginInfoEx;
begin
end.