From 11e70d8c4e224d80015fffe0378c53abee5fd824 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 17 May 2018 19:41:35 +0300 Subject: Popup, PManagerEx, QuickContacts, RemovePersonalSettings, Restart, SeenPlugin, SendSS, ShlExt, SimpleAR, SimpleStatusMsg, SkypeStatusChange, SmileyAdd, SMS => CMPlugin --- plugins/Restart/src/restart.cpp | 23 +++++++++++++++-------- plugins/Restart/src/stdafx.h | 1 - 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'plugins/Restart') diff --git a/plugins/Restart/src/restart.cpp b/plugins/Restart/src/restart.cpp index 08cb470b64..d274593254 100644 --- a/plugins/Restart/src/restart.cpp +++ b/plugins/Restart/src/restart.cpp @@ -1,9 +1,18 @@ #include "stdafx.h" -HINSTANCE hInst; +struct CMPlugin : public PLUGIN +{ + CMPlugin() : + PLUGIN(nullptr) + {} +} +g_plugin; + int hLangpack; HANDLE hRestartMe; +///////////////////////////////////////////////////////////////////////////////////////// + PLUGININFOEX pluginInfo={ sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -17,17 +26,13 @@ PLUGININFOEX pluginInfo={ {0x61bedf3a, 0xcc2, 0x41a3, {0xb9, 0x80, 0xbb, 0x93, 0x93, 0x36, 0x89, 0x35}} }; -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) -{ - hInst = hinstDLL; - return TRUE; -} - extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfo; } +///////////////////////////////////////////////////////////////////////////////////////// + static INT_PTR RestartMe(WPARAM, LPARAM) { CallService(MS_SYSTEM_RESTART, 1, 0); @@ -41,7 +46,7 @@ extern "C" __declspec(dllexport) int Load(void) mir_getLP( &pluginInfo ); // IcoLib support - Icon_Register(hInst, LPGEN("Restart Plugin"), &icon, 1); + Icon_Register(g_plugin.getInst(), LPGEN("Restart Plugin"), &icon, 1); hRestartMe = CreateServiceFunction("System/RestartMe", RestartMe); @@ -56,6 +61,8 @@ extern "C" __declspec(dllexport) int Load(void) return 0; } +///////////////////////////////////////////////////////////////////////////////////////// + extern "C" __declspec(dllexport) int Unload(void) { return 0; diff --git a/plugins/Restart/src/stdafx.h b/plugins/Restart/src/stdafx.h index 90e05480bb..13536d7f07 100644 --- a/plugins/Restart/src/stdafx.h +++ b/plugins/Restart/src/stdafx.h @@ -3,7 +3,6 @@ #define WIN32_LEAN_AND_MEAN #include -#define __NO_CMPLUGIN_NEEDED #include #include #include -- cgit v1.2.3