<< _T(" scanCode=") << i_kid->scanCode\r
<< _T(" flags=") << i_kid->flags << std::endl;\r
#endif\r
- if (i_kid->flags & LLKHF_INJECTED) {\r
+ if ((i_kid->flags & LLKHF_INJECTED) || !m_isEnabled) {\r
return 0;\r
} else {\r
Key key;\r
\r
unsigned int Engine::mouseDetour(WPARAM i_message, MSLLHOOKSTRUCT *i_mid)\r
{\r
- if (i_mid->flags & LLMHF_INJECTED || !m_setting || !m_setting->m_mouseEvent) {\r
+ if (i_mid->flags & LLMHF_INJECTED || !m_isEnabled || !m_setting || !m_setting->m_mouseEvent) {\r
return 0;\r
} else {\r
KEYBOARD_INPUT_DATA kid;\r
}\r
\r
\r
-// command notify\r
-void Engine::commandNotify(\r
- HWND i_hwnd, UINT i_message, WPARAM i_wParam, LPARAM i_lParam) {\r
- Acquire b(&m_log, 0);\r
- HWND hf = m_hwndFocus;\r
- if (!hf)\r
- return;\r
-\r
- if (GetWindowThreadProcessId(hf, NULL) ==\r
- GetWindowThreadProcessId(m_hwndAssocWindow, NULL))\r
- return; // inhibit the investigation of MADO TSUKAI NO YUUTSU\r
-\r
- const _TCHAR *target = NULL;\r
- int number_target = 0;\r
-\r
- if (i_hwnd == hf)\r
- target = _T("ToItself");\r
- else if (i_hwnd == GetParent(hf))\r
- target = _T("ToParentWindow");\r
- else {\r
- // Function::toMainWindow\r
- HWND h = hf;\r
- while (true) {\r
- HWND p = GetParent(h);\r
- if (!p)\r
- break;\r
- h = p;\r
- }\r
- if (i_hwnd == h)\r
- target = _T("ToMainWindow");\r
- else {\r
- // Function::toOverlappedWindow\r
- HWND h = hf;\r
- while (h) {\r
-#ifdef MAYU64\r
- LONG_PTR style = GetWindowLongPtr(h, GWL_STYLE);\r
-#else\r
- LONG style = GetWindowLong(h, GWL_STYLE);\r
-#endif\r
- if ((style & WS_CHILD) == 0)\r
- break;\r
- h = GetParent(h);\r
- }\r
- if (i_hwnd == h)\r
- target = _T("ToOverlappedWindow");\r
- else {\r
- // number\r
- HWND h = hf;\r
- for (number_target = 0; h; number_target ++, h = GetParent(h))\r
- if (i_hwnd == h)\r
- break;\r
- return;\r
- }\r
- }\r
- }\r
-\r
- m_log << _T("&PostMessage(");\r
- if (target)\r
- m_log << target;\r
- else\r
- m_log << number_target;\r
- m_log << _T(", ") << i_message\r
- << _T(", 0x") << std::hex << i_wParam\r
- << _T(", 0x") << i_lParam << _T(") # hwnd = ")\r
- << reinterpret_cast<int>(i_hwnd) << _T(", ")\r
- << _T("message = ") << std::dec;\r
- if (i_message == WM_COMMAND)\r
- m_log << _T("WM_COMMAND, ");\r
- else if (i_message == WM_SYSCOMMAND)\r
- m_log << _T("WM_SYSCOMMAND, ");\r
- else\r
- m_log << i_message << _T(", ");\r
- m_log << _T("wNotifyCode = ") << HIWORD(i_wParam) << _T(", ")\r
- << _T("wID = ") << LOWORD(i_wParam) << _T(", ")\r
- << _T("hwndCtrl = 0x") << std::hex << i_lParam << std::dec << std::endl;\r
-}\r
-\r
unsigned int WINAPI Engine::InputHandler::run(void *i_this)\r
{\r
reinterpret_cast<InputHandler*>(i_this)->run();\r