summaryrefslogtreecommitdiff
path: root/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp
diff options
context:
space:
mode:
authorMataes <mataes2007@gmail.com>2018-05-16 22:58:35 +0300
committerMataes <mataes2007@gmail.com>2018-05-16 22:58:35 +0300
commit56239fcddd46400d812d83e38597d593b5c0356d (patch)
tree9e8d35c9a990c2ff6b687ca53065d0c5a4bd3ac1 /plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp
parent650fc5a2103cedfe149500ade9c684ecf381d348 (diff)
HistoryLinkList, HistoryStats, historysweeperlight, httpserver, HwHotKeys: cmplugin adaptation
Diffstat (limited to 'plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp')
-rw-r--r--plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp
index dce4f52a75..7910ed2219 100644
--- a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp
+++ b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp
@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 - 1307, USA.
#include "stdafx.h"
-HINSTANCE hInstance;
+CMPlugin g_plugin;
int hLangpack;
HWND hDialogWnd = nullptr; // хэндл окна настроек, он глобально используется для вывода туда в реалтайме сканкодов клавы из хука
HHOOK hHook;
@@ -67,14 +67,6 @@ CHAR key_name_buffer[150]; // буфер куда печатается имя к
// ============================================================================
-BOOL APIENTRY DllMain( HMODULE hModule, DWORD, LPVOID)
-{
- hInstance = hModule;
- return TRUE;
-}
-
-// ============================================================================
-
PLUGININFOEX PluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -112,10 +104,10 @@ extern "C" __declspec(dllexport) int Load(void)
HookEvent(ME_OPT_INITIALISE, initializeOptions);
// установка хука для низкоуровневой обработки хоткеев
- hHook = SetWindowsHookExA(WH_KEYBOARD_LL, key_hook, hInstance, 0);
+ hHook = SetWindowsHookExA(WH_KEYBOARD_LL, key_hook, g_plugin.getInst(), 0);
-// StringCbPrintfA(key_name_buffer, 100, "hHook = 0x%x, Err = %u", hHook, GetLastError);
-// MessageBoxA(0, key_name_buffer, 0, 0);
+ // StringCbPrintfA(key_name_buffer, 100, "hHook = 0x%x, Err = %u", hHook, GetLastError);
+ // MessageBoxA(0, key_name_buffer, 0, 0);
return 0;
}
@@ -126,7 +118,7 @@ int initializeOptions(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE OptDlgPg = { sizeof(OptDlgPg) };
OptDlgPg.position = 100000000;
- OptDlgPg.hInstance = hInstance;
+ OptDlgPg.hInstance = g_plugin.getInst();
OptDlgPg.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
OptDlgPg.pszTemplate = MAKEINTRESOURCEA(dlg_options);
OptDlgPg.szGroup.w = LPGENW("Customize");