diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-20 15:08:48 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-20 15:08:48 +0300 |
commit | 8a74e7495ce5ad39de4f5c25121a84d35df90c36 (patch) | |
tree | 03e5b4870f09a3163306740c2eebee47bc15b042 /plugins/Import/src/main.cpp | |
parent | c5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff) |
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'plugins/Import/src/main.cpp')
-rw-r--r-- | plugins/Import/src/main.cpp | 45 |
1 files changed, 24 insertions, 21 deletions
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<CMPlugin>(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);
|