diff options
Diffstat (limited to 'plugins/Restart/src')
-rw-r--r-- | plugins/Restart/src/restart.cpp | 23 | ||||
-rw-r--r-- | plugins/Restart/src/stdafx.h | 1 |
2 files changed, 15 insertions, 9 deletions
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>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(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 <windows.h>
-#define __NO_CMPLUGIN_NEEDED
#include <newpluginapi.h>
#include <m_langpack.h>
#include <m_genmenu.h>
|