summaryrefslogtreecommitdiff
path: root/plugins/Restart/src
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-09-18 17:59:18 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-09-18 17:59:18 +0000
commit6643af9a0ce6d8531f2843c087bc69951755e8f0 (patch)
treee09fbb83b887cd235fcb72ca5ffc778932609140 /plugins/Restart/src
parent5f03b2ef4bf1a94d7a73dafc070e1d569f8c22b4 (diff)
Restart piugin added
git-svn-id: http://svn.miranda-ng.org/main/trunk@1596 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Restart/src')
-rw-r--r--plugins/Restart/src/resource.h17
-rw-r--r--plugins/Restart/src/restart.c80
2 files changed, 97 insertions, 0 deletions
diff --git a/plugins/Restart/src/resource.h b/plugins/Restart/src/resource.h
new file mode 100644
index 0000000000..0c6d35d224
--- /dev/null
+++ b/plugins/Restart/src/resource.h
@@ -0,0 +1,17 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by Restart.rc
+//
+#define IDI_ICON1 101
+#define IDI_RESTARTICON 101
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 102
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/plugins/Restart/src/restart.c b/plugins/Restart/src/restart.c
new file mode 100644
index 0000000000..2c09f2f0ab
--- /dev/null
+++ b/plugins/Restart/src/restart.c
@@ -0,0 +1,80 @@
+#include <windows.h>
+#include <newpluginapi.h>
+#include <m_clist.h>
+#include <m_skin.h>
+#include <m_icolib.h>
+#include <m_langpack.h>
+#include <m_system.h>
+#include <m_genmenu.h>
+#include "resource.h"
+
+HINSTANCE hInst;
+HANDLE hIconHandle;
+int hLangpack;
+
+PLUGININFOEX pluginInfo={
+ sizeof(PLUGININFOEX),
+ "Restart plugin",
+ PLUGIN_MAKE_VERSION(0,0,6,0),
+ "Adds Restart menu item",
+ "(..нужное вписать..)",
+ "ep@eugn.me",
+ "© 2008 - 2012 -=J-Scar=-",
+ "http://miranda.im",
+ UNICODE_AWARE,
+ 0x61bedf3a, 0xcc2, 0x41a3, { 0xb9, 0x80, 0xbb, 0x93, 0x93, 0x36, 0x89, 0x35 } // {61BEDF3A-0CC2-41a3-B980-BB9393368935}
+};
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+{
+ hInst = hinstDLL;
+ return TRUE;
+}
+
+static int RestartMenuCommand(WPARAM wParam,LPARAM lParam)
+{
+ CallService("Miranda/System/Restart",0,0);
+ CallService("CloseAction",0,0);
+ return 0;
+}
+
+__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+ return &pluginInfo;
+}
+
+int __declspec(dllexport) Load(void)
+{
+ SKINICONDESC sid = {0};
+ CLISTMENUITEM mi = {0};
+ TCHAR szFile[MAX_PATH];
+
+ // IcoLib support
+ GetModuleFileName(hInst, szFile, MAX_PATH);
+ sid.pszDefaultFile = szFile;
+ sid.cbSize = sizeof(sid);
+
+ sid.pszSection = "Restart Plugin";
+ sid.pszDescription = "Restart";
+ sid.pszName = "rst_restart_icon";
+ sid.iDefaultIndex = -IDI_RESTARTICON;
+ hIconHandle = Skin_AddIcon(&sid);
+
+ CreateServiceFunction("RestartPlug/MenuCommand",RestartMenuCommand);
+
+ mi.cbSize = sizeof(mi);
+ mi.position = -0x7FFFFFFF;
+ mi.flags = CMIF_ICONFROMICOLIB;
+ mi.icolibItem = hIconHandle;
+ mi.pszName="Restart";
+ mi.pszService="RestartPlug/MenuCommand";
+ Menu_AddMainMenuItem(&mi);
+ Menu_AddTrayMenuItem(&mi);
+ return 0;
+}
+
+
+int __declspec(dllexport) Unload(void)
+{
+ return 0;
+} \ No newline at end of file