diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-05-15 10:38:20 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-05-15 10:38:20 +0000 |
commit | 48540940b6c28bb4378abfeb500ec45a625b37b6 (patch) | |
tree | 2ef294c0763e802f91d868bdef4229b6868527de /include/delphi/testdll.dpr | |
parent | 5c350913f011e119127baeb32a6aedeb4f0d33bc (diff) |
initial commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/delphi/testdll.dpr')
-rw-r--r-- | include/delphi/testdll.dpr | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/include/delphi/testdll.dpr b/include/delphi/testdll.dpr new file mode 100644 index 0000000000..478212d82c --- /dev/null +++ b/include/delphi/testdll.dpr @@ -0,0 +1,60 @@ +library testdll;
+
+uses
+
+ 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;
+
+begin
+end.
|