summaryrefslogtreecommitdiff
path: root/xframes/xframes.cpp
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2006-11-01 14:58:17 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2006-11-01 14:58:17 +0000
commit9a1b2f988762967da30e6f4d2575dc2dfe99a21a (patch)
treee21dab2141e93e87a604e29896438c41b035e8e9 /xframes/xframes.cpp
parentd513db102812c5dd83f94084e979bb7e24345498 (diff)
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@25 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'xframes/xframes.cpp')
-rw-r--r--xframes/xframes.cpp109
1 files changed, 109 insertions, 0 deletions
diff --git a/xframes/xframes.cpp b/xframes/xframes.cpp
new file mode 100644
index 0000000..fae3cef
--- /dev/null
+++ b/xframes/xframes.cpp
@@ -0,0 +1,109 @@
+// xframes.cpp : Defines the entry point for the DLL application.
+//
+
+#include "common.h"
+#include "xframes.h"
+#include "options.h"
+#include "frames.h"
+
+HINSTANCE hInst;
+PLUGINLINK *pluginLink;
+
+HANDLE mainThread;
+
+bool metacontacts_installed;
+bool unicode_system;
+
+int code_page = CP_ACP;
+
+HANDLE popupWindowList;
+
+DWORD focusTimerId = 0;
+
+PLUGININFO pluginInfo={
+ sizeof(PLUGININFO),
+ "XFrames",
+ PLUGIN_MAKE_VERSION(0,0,1,2),
+ "External frames support",
+ "Scott Ellis",
+ "mail@scottellis.com.au",
+ "© 2005 Scott Ellis",
+ "http://www.scottellis.com.au/",
+ 0, //not transient
+ 0 //doesn't replace anything built-in
+};
+
+
+extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+{
+ hInst=hinstDLL;
+ DisableThreadLibraryCalls(hInst);
+ return TRUE;
+}
+
+extern "C" __declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion)
+{
+ return &pluginInfo;
+}
+
+int OnModulesLoaded(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;
+
+ update.szBetaUpdateURL = "http://www.scottellis.com.au/miranda_plugins/xframes.zip";
+ update.szBetaVersionURL = "http://www.scottellis.com.au/miranda_plugins/ver_xframes.html";
+ update.pbBetaVersionPrefix = (BYTE *)"XFrames version ";
+ update.cpbBetaVersionPrefix = strlen((char *)update.pbBetaVersionPrefix);
+
+ CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
+ }
+
+ return 0;
+}
+
+int OnPreShutdown(WPARAM wParam, LPARAM lParam) {
+ return 0;
+}
+
+extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+{
+ if(GetModuleHandle(_T("clist_modern")) || GetModuleHandle(_T("clist_nicer")) || GetModuleHandle(_T("clist_mw")))
+ return 1;
+
+ pluginLink = link;
+ DuplicateHandle( GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &mainThread, THREAD_SET_CONTEXT, FALSE, 0 );
+
+ char szVer[128];
+ unicode_system = (CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)sizeof(szVer), (LPARAM)szVer) == 0 && strstr(szVer, "Unicode"));
+ if(ServiceExists(MS_LANGPACK_GETCODEPAGE)) code_page = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+
+ // Ensure that the common control DLL is loaded (for listview)
+ INITCOMMONCONTROLSEX icex;
+ icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
+ icex.dwICC = ICC_LISTVIEW_CLASSES;
+ InitCommonControlsEx(&icex);
+
+ LoadOptions();
+ InitFrames();
+
+ HookEvent(ME_OPT_INITIALISE, OptInit);
+ HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+
+ return 0;
+}
+
+extern "C" int __declspec(dllexport) Unload(void)
+{
+ DeinitFrames();
+ return 0;
+}