From 8a74e7495ce5ad39de4f5c25121a84d35df90c36 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 May 2018 15:08:48 +0300 Subject: CMPlugin to receive a reference to PLUGININFOEX --- plugins/Import/src/main.cpp | 45 ++++++++++++++++++++++++--------------------- plugins/Import/src/stdafx.h | 4 +--- 2 files changed, 25 insertions(+), 24 deletions(-) (limited to 'plugins/Import') diff --git a/plugins/Import/src/main.cpp b/plugins/Import/src/main.cpp index cd2832123c..7781299b35 100644 --- a/plugins/Import/src/main.cpp +++ b/plugins/Import/src/main.cpp @@ -31,8 +31,10 @@ HWND hwndWizard, hwndAccMerge; CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang); -PLUGININFOEX pluginInfo = -{ +///////////////////////////////////////////////////////////////////////////////////////// +// MirandaPluginInfoEx - returns an information about a plugin + +static PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -41,30 +43,17 @@ PLUGININFOEX pluginInfo = __COPYRIGHT, __AUTHORWEB, UNICODE_AWARE, - //{2D77A746-00A6-4343-BFC5-F808CDD772EA} + // {2D77A746-00A6-4343-BFC5-F808CDD772EA} {0x2d77a746, 0xa6, 0x4343, {0xbf, 0xc5, 0xf8, 0x8, 0xcd, 0xd7, 0x72, 0xea}} }; -static INT_PTR ImportCommand(WPARAM, LPARAM) -{ - if (IsWindow(hwndWizard)) { - SetForegroundWindow(hwndWizard); - SetFocus(hwndWizard); - } - else { - WizardDlgParam param = { IDD_WIZARDINTRO, (LPARAM)WizardIntroPageProc }; - CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_WIZARD), nullptr, WizardDlgProc, (LPARAM)¶m); - } - - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// MirandaPluginInfoEx - returns an information about a plugin +CMPlugin::CMPlugin() : + PLUGIN(IMPORT_MODULE, pluginInfoEx) +{} extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -136,9 +125,23 @@ static INT_PTR CustomImport(WPARAM wParam, LPARAM) return DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_WIZARD), nullptr, WizardDlgProc, LPARAM(¶m)); } +static INT_PTR ImportCommand(WPARAM, LPARAM) +{ + if (IsWindow(hwndWizard)) { + SetForegroundWindow(hwndWizard); + SetFocus(hwndWizard); + } + else { + WizardDlgParam param = { IDD_WIZARDINTRO, (LPARAM)WizardIntroPageProc }; + CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_WIZARD), nullptr, WizardDlgProc, (LPARAM)¶m); + } + + return 0; +} + extern "C" __declspec(dllexport) int Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); CreateServiceFunction(IMPORT_SERVICE, ImportCommand); CreateServiceFunction(MS_SERVICEMODE_LAUNCH, ServiceMode); diff --git a/plugins/Import/src/stdafx.h b/plugins/Import/src/stdafx.h index 822cf6721e..c3fafad1e4 100644 --- a/plugins/Import/src/stdafx.h +++ b/plugins/Import/src/stdafx.h @@ -56,9 +56,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN { - CMPlugin() : - PLUGIN(IMPORT_MODULE) - {} + CMPlugin(); }; // Keys -- cgit v1.2.3