summaryrefslogtreecommitdiff
path: root/plugins/HwHotKeys/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
commit8a74e7495ce5ad39de4f5c25121a84d35df90c36 (patch)
tree03e5b4870f09a3163306740c2eebee47bc15b042 /plugins/HwHotKeys/src
parentc5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff)
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'plugins/HwHotKeys/src')
-rw-r--r--plugins/HwHotKeys/src/HwHotKeys_Dlg.cpp6
-rw-r--r--plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp17
-rw-r--r--plugins/HwHotKeys/src/stdafx.h6
-rw-r--r--plugins/HwHotKeys/src/version.h2
4 files changed, 16 insertions, 15 deletions
diff --git a/plugins/HwHotKeys/src/HwHotKeys_Dlg.cpp b/plugins/HwHotKeys/src/HwHotKeys_Dlg.cpp
index 012da96a25..934b01863f 100644
--- a/plugins/HwHotKeys/src/HwHotKeys_Dlg.cpp
+++ b/plugins/HwHotKeys/src/HwHotKeys_Dlg.cpp
@@ -87,11 +87,11 @@ INT_PTR CALLBACK OptDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
case PSN_APPLY: // система просит сохранить настройки плагина
code_Close = code_Close_tmp;
- db_set_dw(0, __DbModName, "Close", code_Close_tmp);
+ db_set_dw(0, MODULENAME, "Close", code_Close_tmp);
code_HideShow = code_HideShow_tmp;
- db_set_dw(0, __DbModName, "HideShow", code_HideShow_tmp);
+ db_set_dw(0, MODULENAME, "HideShow", code_HideShow_tmp);
code_ReadMsg = code_ReadMsg_tmp;
- db_set_dw(0, __DbModName, "ReadMsg", code_ReadMsg_tmp);
+ db_set_dw(0, MODULENAME, "ReadMsg", code_ReadMsg_tmp);
break; //case PSN_APPLY
}
break; //case 0
diff --git a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp
index 63d0a172fa..2e4b74d94c 100644
--- a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp
+++ b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp
@@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 - 1307, USA.
CMPlugin g_plugin;
int &hLangpack(g_plugin.m_hLang);
+
HWND hDialogWnd = nullptr; // хэндл окна настроек, он глобально используется для вывода туда в реалтайме сканкодов клавы из хука
HHOOK hHook;
CLIST_INTERFACE *pcli;
@@ -67,7 +68,7 @@ CHAR key_name_buffer[150]; // буфер куда печатается имя к
// ============================================================================
-PLUGININFOEX PluginInfoEx = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -80,9 +81,13 @@ PLUGININFOEX PluginInfoEx = {
{ 0x315b3800, 0x8258, 0x44c4, { 0xb6, 0xe, 0x58, 0xc5, 0xb, 0x93, 0x3, 0xb6 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD)
{
- return &PluginInfoEx;
+ return &pluginInfoEx;
}
// ============================================================================
@@ -90,12 +95,12 @@ extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD)
extern "C" __declspec(dllexport) int Load(void)
{
// загружаем (из БД) настройки плагина
- code_Close = db_get_dw(0, __DbModName, "Close", 0);
- code_HideShow = db_get_dw(0, __DbModName, "HideShow", 0);
- code_ReadMsg = db_get_dw(0, __DbModName, "ReadMsg", 0);
+ code_Close = db_get_dw(0, MODULENAME, "Close", 0);
+ code_HideShow = db_get_dw(0, MODULENAME, "HideShow", 0);
+ code_ReadMsg = db_get_dw(0, MODULENAME, "ReadMsg", 0);
// установка кода локализации - макрос mir_getLP(PlgInfoEx)
- mir_getLP(&PluginInfoEx);
+ mir_getLP(&pluginInfoEx);
// Интерфейс контактлиста - макрос заполняет CLIST_INTERFACE *pcli;
pcli = Clist_GetInterface();
diff --git a/plugins/HwHotKeys/src/stdafx.h b/plugins/HwHotKeys/src/stdafx.h
index fdd33abd39..da95e622c5 100644
--- a/plugins/HwHotKeys/src/stdafx.h
+++ b/plugins/HwHotKeys/src/stdafx.h
@@ -38,14 +38,10 @@ INT_PTR CALLBACK OptDlgProc(HWND, UINT, WPARAM, LPARAM);
VOID HwHotKeys_PrintFullKeyname(DWORD);
BOOL HwHotKeys_CompareCurrentScancode(DWORD);
LRESULT CALLBACK key_hook(INT, WPARAM, LPARAM);
-extern CLIST_INTERFACE *pcli;
-
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(__DbModName)
- {}
+ CMPlugin();
};
extern HWND hDialogWnd; // глобально используется для вывода туда в реалтайме сканкодов клавы, из хука
diff --git a/plugins/HwHotKeys/src/version.h b/plugins/HwHotKeys/src/version.h
index 2ab9099fbb..c2bd0de364 100644
--- a/plugins/HwHotKeys/src/version.h
+++ b/plugins/HwHotKeys/src/version.h
@@ -36,5 +36,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 - 1307, USA.
#define __AUTHORWEB "http://f2065.narod.ru/" // описание плагина в dll-fileinfo "CompanyName", описание плагина в миранде
#define __COPYRIGHT "© 2010-18 Eugene f2065" // описание плагина в dll-fileinfo "LegalCopyright", описание плагина в миранде
-#define __DbModName "HwHotKeys" // имя раздела настроек плагина в БД миранды
+#define MODULENAME "HwHotKeys" // имя раздела настроек плагина в БД миранды