From 8029b70725875a41ee394aabcbe4d39b658a6364 Mon Sep 17 00:00:00 2001 From: sje Date: Fri, 2 Feb 2007 14:17:26 +0000 Subject: git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@107 4f64403b-2f21-0410-a795-97e2b3489a10 --- MirandaPlugin/Templates/1033/base.cpp | 95 +++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 MirandaPlugin/Templates/1033/base.cpp (limited to 'MirandaPlugin/Templates/1033/base.cpp') diff --git a/MirandaPlugin/Templates/1033/base.cpp b/MirandaPlugin/Templates/1033/base.cpp new file mode 100644 index 0000000..d0cb971 --- /dev/null +++ b/MirandaPlugin/Templates/1033/base.cpp @@ -0,0 +1,95 @@ +/* Replace "dll.h" with the name of your header */ +#include "common.h" +#include "version.h" +#include "resource.h" +[!if OPTIONS_PAGE] +#include "options.h" +[!endif] +[!if FILTER_CODE] +#include "filter.h" +[!endif] +[!if USE_NETLIB] +#include "net.h" +[!endif] +[!if MAIN_MENU || CONTACT_MENU] +#include "menu.h" +[!endif] + +/////////////////////////////////////////////// +// Common Plugin Stuff +/////////////////////////////////////////////// +HINSTANCE hInst; +PLUGINLINK *pluginLink; + +PLUGININFO pluginInfo={ + sizeof(PLUGININFO), + //META_PROTO, + __PLUGIN_NAME, // altered here and on file listing, so as not to match original + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESC, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, + 0, + 0 +}; + + +extern "C" BOOL APIENTRY DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) { + hInst=hinstDLL; + return TRUE; +} + +extern "C" __declspec (dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion) { + return &pluginInfo; +} + +int ModulesLoaded(WPARAM wParam, LPARAM lParam) { +[!if USE_NETLIB] + InitNetlib(); +[!endif] +[!if MAIN_MENU || CONTACT_MENU] + InitMenu(); +[!endif] + + return 0; +} + +HANDLE hModulesLoaded; +extern "C" __declspec (dllexport) int Load(PLUGINLINK *link) { + pluginLink=link; + +[!if OPTIONS_PAGE] + InitOptions(); +[!endif] +[!if FILTER_CODE] + + ///////////// + ////// init filter + RegisterFilter(); + AddFilterToContacts(); +[!endif] + + // hook modules loaded + hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); + return 0; +} + +extern "C" __declspec (dllexport) int Unload(void) { + UnhookEvent(hModulesLoaded); +[!if MAIN_MENU || CONTACT_MENU] + DeinitMenu(); +[!endif] +[!if USE_NETLIB] + DeinitNetlib(); +[!endif] +[!if FILTER_CODE] + DeinitFilter(); +[!endif] +[!if OPTIONS_PAGE] + DeinitOptions(); +[!endif] + + return 0; +} -- cgit v1.2.3