diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-27 07:04:06 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-27 07:04:06 +0000 |
commit | adc5442e0cbaec78f5c81fa672e3e14e4c928f59 (patch) | |
tree | 2090ab5a08c2c060b1db52c231b9d6ed608cf654 /plugins/DbChecker/src/main.cpp | |
parent | 1718ecd06e6bb305385e5dea79c5649af6e9470a (diff) |
dbchecker - initial version
git-svn-id: http://svn.miranda-ng.org/main/trunk@1208 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/DbChecker/src/main.cpp')
-rw-r--r-- | plugins/DbChecker/src/main.cpp | 65 |
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;
+}
|