From 50b715009438967fa9b37a62649db216ce8021b7 Mon Sep 17 00:00:00 2001 From: sje Date: Wed, 25 Apr 2007 15:34:26 +0000 Subject: git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@145 4f64403b-2f21-0410-a795-97e2b3489a10 --- nohtml/nohtml.cpp | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 nohtml/nohtml.cpp (limited to 'nohtml/nohtml.cpp') diff --git a/nohtml/nohtml.cpp b/nohtml/nohtml.cpp new file mode 100644 index 0000000..8cf58c6 --- /dev/null +++ b/nohtml/nohtml.cpp @@ -0,0 +1,104 @@ +/* Replace "dll.h" with the name of your header */ +#include "common.h" +#include "version.h" +#include "resource.h" +#include "options.h" +#include "filter.h" + +/////////////////////////////////////////////// +// Common Plugin Stuff +/////////////////////////////////////////////// +HINSTANCE hInst; +PLUGINLINK *pluginLink; + +PLUGININFOEX pluginInfo={ + sizeof(PLUGININFOEX), + //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, + // TODO: generate your own GUID!! + { 0xD78C8249, 0xE8DB, 0x46B1, { 0x92, 0xF3, 0x88, 0xE6, 0xDC, 0x96, 0x4E, 0x8D } } +}; + + +extern "C" BOOL APIENTRY DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) { + hInst=hinstDLL; + return TRUE; +} + +extern "C" __declspec (dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { + return &pluginInfo; +} + +extern "C" __declspec (dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion) { + pluginInfo.cbSize = sizeof(PLUGININFO); + return (PLUGININFO*)&pluginInfo; +} + +static const MUUID interfaces[] = {MIID_NOHTML, MIID_LAST}; +extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) +{ + return interfaces; +} + +int ModulesLoaded(WPARAM wParam, LPARAM lParam) { + if(ServiceExists(MS_UPDATE_REGISTER)) { + // register with updater + Update update = {0}; + char szVersion[16]; + + update.cbSize = sizeof(Update); + + update.szComponentName = pluginInfo.shortName; + update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion); + update.cpbVersion = strlen((char *)update.pbVersion); + + update.szUpdateURL = UPDATER_AUTOREGISTER; + + // these are the three lines that matter - the archive, the page containing the version string, and the text (or data) + // before the version that we use to locate it on the page + // (note that if the update URL and the version URL point to standard file listing entries, the backend xml + // data will be used to check for updates rather than the actual web page - this is not true for beta urls) + update.szBetaUpdateURL = "http://www.scottellis.com.au/miranda_plugins/nohtml.zip"; + update.szBetaVersionURL = "http://www.scottellis.com.au/miranda_plugins/ver_nohtml.html"; + update.pbBetaVersionPrefix = (BYTE *)"No HTML version "; + + update.cpbBetaVersionPrefix = strlen((char *)update.pbBetaVersionPrefix); + + CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update); + } + + + return 0; +} + +HANDLE hModulesLoaded; +extern "C" __declspec (dllexport) int Load(PLUGINLINK *link) { + pluginLink=link; + + InitOptions(); + + ///////////// + ////// init filter + RegisterFilter(); + AddFilterToContacts(); + + // hook modules loaded + hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); + return 0; +} + +extern "C" __declspec (dllexport) int Unload(void) { + UnhookEvent(hModulesLoaded); + DeinitFilter(); + DeinitOptions(); + + return 0; +} -- cgit v1.2.3