diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-06-27 17:05:05 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-06-27 17:05:05 +0000 |
commit | cbd22101bcff041e598aba668412d0a4232b58e3 (patch) | |
tree | 984f7afe9ec9246719e185288f8a2e96f4bc0665 /MySpace/MySpace.cpp | |
parent | 353f66dee3f468aaf7cc0d0ab314df89ae56c428 (diff) |
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@217 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'MySpace/MySpace.cpp')
-rw-r--r-- | MySpace/MySpace.cpp | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/MySpace/MySpace.cpp b/MySpace/MySpace.cpp new file mode 100644 index 0000000..39540df --- /dev/null +++ b/MySpace/MySpace.cpp @@ -0,0 +1,87 @@ +/* Replace "dll.h" with the name of your header */
+#include "common.h"
+#include "version.h"
+#include "resource.h"
+#include "options.h"
+#include "proto.h"
+#include "net.h"
+#include "menu.h"
+
+///////////////////////////////////////////////
+// Common Plugin Stuff
+///////////////////////////////////////////////
+HINSTANCE hInst;
+PLUGINLINK *pluginLink;
+HANDLE mainThread;
+
+PLUGININFOEX pluginInfo={
+ sizeof(PLUGININFOEX),
+ __PLUGIN_NAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESC,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
+ 0,
+ { 0xA0D1D7B2, 0x6B1, 0x437D, { 0x84, 0x91, 0xA7, 0x46, 0x58, 0xB9, 0x63, 0x70 } }
+};
+
+
+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;
+}
+
+
+// uncomment this for pre 0.7 compatibility
+extern "C" __declspec (dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion) {
+ pluginInfo.cbSize = sizeof(PLUGININFO);
+ return (PLUGININFO*)&pluginInfo;
+}
+
+static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
+{
+ return interfaces;
+}
+
+int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
+ InitNetlib();
+ InitMenu();
+
+ return 0;
+}
+
+HANDLE hModulesLoaded;
+extern "C" __declspec (dllexport) int Load(PLUGINLINK *link) {
+ DuplicateHandle( GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &mainThread, THREAD_SET_CONTEXT, FALSE, 0 );
+
+ pluginLink=link;
+
+ InitOptions();
+
+ /////////////
+ ////// init protocol
+ RegisterProto();
+ CreateProtoServices();
+
+ // hook modules loaded
+ hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
+ return 0;
+}
+
+extern "C" __declspec (dllexport) int Unload(void) {
+ UnhookEvent(hModulesLoaded);
+ DeinitMenu();
+ DeinitNetlib();
+ DeinitProto();
+ DeinitOptions();
+
+ return 0;
+}
|