diff options
Diffstat (limited to 'plugins/PluginUpdater/src/PluginUpdater.cpp')
-rw-r--r-- | plugins/PluginUpdater/src/PluginUpdater.cpp | 51 |
1 files changed, 12 insertions, 39 deletions
diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp index d3728d8e39..cc4f361e95 100644 --- a/plugins/PluginUpdater/src/PluginUpdater.cpp +++ b/plugins/PluginUpdater/src/PluginUpdater.cpp @@ -19,10 +19,12 @@ Boston, MA 02111-1307, USA. #include "stdafx.h"
-HINSTANCE hInst = nullptr;
-wchar_t g_tszRoot[MAX_PATH] = {0}, g_tszTempPath[MAX_PATH];
int hLangpack;
-DWORD g_mirandaVersion;
+CMPlugin g_plugin;
+
+wchar_t g_tszRoot[MAX_PATH] = {0}, g_tszTempPath[MAX_PATH];
+
+/////////////////////////////////////////////////////////////////////////////////////////
PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
@@ -33,42 +35,23 @@ PLUGININFOEX pluginInfoEx = { __COPYRIGHT,
__AUTHORWEB,
UNICODE_AWARE,
-#if MIRANDA_VER < 0x0A00
- 0,
-#endif
// {968DEF4A-BC60-4266-AC08-754CE721DB5F}
{0x968def4a, 0xbc60, 0x4266, {0xac, 0x8, 0x75, 0x4c, 0xe7, 0x21, 0xdb, 0x5f}}
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- hInst = hinstDLL;
- return TRUE;
-}
-
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
-{
- g_mirandaVersion = mirandaVersion;
return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
-#if MIRANDA_VER < 0x0A00
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
-{
- pluginLink = link;
- mir_getMMI(&mmi);
- li.cbSize = LIST_INTERFACE_V2_SIZE;
- CallService(MS_SYSTEM_GET_LI, 0, (LPARAM)&li);
- mir_getMD5I(&md5i);
- mir_getUTFI(&utfi);
-#else
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
InitServices();
-#endif
+
db_set_b(NULL, MODNAME, DB_SETTING_NEED_RESTART, 0);
DWORD dwLen = GetTempPath(_countof(g_tszTempPath), g_tszTempPath);
@@ -83,23 +66,15 @@ extern "C" __declspec(dllexport) int Load(void) // Add cheking update menu item
InitCheck();
-#if MIRANDA_VER >= 0x0A00
CMenuItem mi;
SET_UID(mi, 0xfa2cbe01, 0x3b37, 0x4a4c, 0xa6, 0x97, 0xe4, 0x6f, 0x31, 0xa9, 0xfc, 0x33);
mi.name.a = LPGEN("Check for updates");
mi.hIcolibItem = iconList[0].hIcolib;
-#else
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
- mi.icolibItem = IcoLib_GetIconHandle("check_update");
- mi.pszName = LPGEN("Check for updates");
-#endif
mi.position = 400010000;
mi.pszService = MS_PU_CHECKUPDATES;
Menu_AddMainMenuItem(&mi);
-#if MIRANDA_VER >= 0x0A00
InitListNew();
SET_UID(mi, 0xafe94fad, 0xea83, 0x41aa, 0xa4, 0x26, 0xcb, 0x4a, 0x1c, 0x37, 0xc1, 0xd3);
@@ -120,11 +95,9 @@ extern "C" __declspec(dllexport) int Load(void) hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, VK_F10) | HKF_MIRANDA_LOCAL;
hkd.lParam = FALSE;
Hotkey_Register(&hkd);
-#endif
InitEvents();
-#if MIRANDA_VER >= 0x0A00
// add sounds
Skin_AddSound("updatecompleted", LPGENW("Plugin Updater"), LPGENW("Update completed"));
Skin_AddSound("updatefailed", LPGENW("Plugin Updater"), LPGENW("Update failed"));
@@ -148,16 +121,16 @@ extern "C" __declspec(dllexport) int Load(void) else db_set_b(0, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_CUSTOM);
}
}
-#endif
+
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Unload(void)
{
UnloadCheck();
- #if MIRANDA_VER >= 0x0A00
- UnloadListNew();
- #endif
+ UnloadListNew();
UnloadNetlib();
return 0;
}
|