summaryrefslogtreecommitdiff
path: root/plugins/Restart
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-17 19:41:35 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-17 19:41:35 +0300
commit11e70d8c4e224d80015fffe0378c53abee5fd824 (patch)
tree8b21511f57aad4a9aaaa9391450cf5b83146a2f8 /plugins/Restart
parent0c12fe889baeced3e7d8c3f2558d10f563a43612 (diff)
Popup, PManagerEx, QuickContacts, RemovePersonalSettings, Restart, SeenPlugin, SendSS, ShlExt, SimpleAR, SimpleStatusMsg, SkypeStatusChange, SmileyAdd, SMS => CMPlugin
Diffstat (limited to 'plugins/Restart')
-rw-r--r--plugins/Restart/src/restart.cpp23
-rw-r--r--plugins/Restart/src/stdafx.h1
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>