From d76054aaa73912cca449378e07305e3c0b1ad608 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 28 Jul 2012 16:24:36 +0000 Subject: fixes for the dbchecker's wizard to operate correctly in the service mode git-svn-id: http://svn.miranda-ng.org/main/trunk@1226 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/DbChecker/src/main.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'plugins/DbChecker/src/main.cpp') diff --git a/plugins/DbChecker/src/main.cpp b/plugins/DbChecker/src/main.cpp index 209bef8a70..4a98a5dd1d 100644 --- a/plugins/DbChecker/src/main.cpp +++ b/plugins/DbChecker/src/main.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. HINSTANCE hInst; int hLangpack = 0; -bool bServiceMode = false; +bool bServiceMode = false, bLaunchMiranda = false; static HANDLE hLaunchFunc; @@ -47,7 +47,7 @@ PLUGININFOEX pluginInfoEx = BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) { - hInst=hinstDLL; + hInst = hinstDLL; return TRUE; } @@ -63,23 +63,16 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_SERVICE static INT_PTR ServiceMode(WPARAM, LPARAM) { + bLaunchMiranda = false; 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; + DialogBox(hInst, MAKEINTRESOURCE(IDD_WIZARD), NULL, WizardDlgProc); + return (bLaunchMiranda) ? SERVICE_CONTINUE : SERVICE_FAILED; } extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfoEx); - HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); - hLaunchFunc = CreateServiceFunction(MS_SERVICEMODE_LAUNCH, ServiceMode); return 0; } -- cgit v1.2.3