summaryrefslogtreecommitdiff
path: root/plugins/DbChecker/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/DbChecker/src/main.cpp')
-rw-r--r--plugins/DbChecker/src/main.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/plugins/DbChecker/src/main.cpp b/plugins/DbChecker/src/main.cpp
index f59f66a13a..209bef8a70 100644
--- a/plugins/DbChecker/src/main.cpp
+++ b/plugins/DbChecker/src/main.cpp
@@ -18,9 +18,74 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "dbchecker.h"
+#include "version.h"
HINSTANCE hInst;
int hLangpack = 0;
+bool bServiceMode = false;
+
+static HANDLE hLaunchFunc;
DbToolOptions opts = {0};
+PLUGININFOEX pluginInfoEx =
+{
+ sizeof(pluginInfoEx),
+ __PLUGIN_NAME,
+ __VERSION_DWORD,
+ __DESCRIPTION,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
+ // {A0138FC6-4C52-4501-AF93-7D3E20BCAE5B}
+ { 0xa0138fc6, 0x4c52, 0x4501, { 0xaf, 0x93, 0x7d, 0x3e, 0x20, 0xbc, 0xae, 0x5b}}
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+{
+ hInst=hinstDLL;
+ return TRUE;
+}
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+ return &pluginInfoEx;
+}
+
+// we implement service mode interface
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_SERVICEMODE, MIID_LAST};
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static INT_PTR ServiceMode(WPARAM, LPARAM)
+{
+ bServiceMode = true;
+ return SERVICE_MONOPOLY; // unload db and open a wizard
+}
+
+static int OnModulesLoaded(WPARAM, LPARAM)
+{
+ if (bServiceMode)
+ DialogBox(hInst, MAKEINTRESOURCE(IDD_WIZARD), NULL, WizardDlgProc);
+ return 0;
+}
+
+extern "C" __declspec(dllexport) int Load(void)
+{
+ mir_getLP(&pluginInfoEx);
+
+ HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+
+ hLaunchFunc = CreateServiceFunction(MS_SERVICEMODE_LAUNCH, ServiceMode);
+ return 0;
+}
+
+extern "C" __declspec(dllexport) int Unload(void)
+{
+ DestroyServiceFunction(hLaunchFunc);
+ return 0;
+}