[BUG_FIXED] Fix vista hook failure.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@445 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2009-04-01 23:30:57 +00:00
parent 05e55ebf66
commit 4826c0b011
4 changed files with 8 additions and 8 deletions

View File

@ -292,11 +292,11 @@ LRESULT DockingCont::runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPAR
hWndServer = _hCaption; hWndServer = _hCaption;
if (GetVersion() & 0x80000000) if (GetVersion() & 0x80000000)
{ {
hookMouse = ::SetWindowsHookEx(WH_MOUSE, (HOOKPROC)hookProcMouse, _hInst, 0); hookMouse = ::SetWindowsHookEx(WH_MOUSE, (HOOKPROC)hookProcMouse, _hInst, GetCurrentThreadId());
} }
else else
{ {
hookMouse = ::SetWindowsHookEx(WH_MOUSE_LL, (HOOKPROC)hookProcMouse, _hInst, 0); hookMouse = ::SetWindowsHookEx(WH_MOUSE_LL, (HOOKPROC)hookProcMouse, _hInst, GetCurrentThreadId());
} }
if (!hookMouse) if (!hookMouse)

View File

@ -143,11 +143,11 @@ LRESULT DockingSplitter::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (GetVersion() & 0x80000000) if (GetVersion() & 0x80000000)
{ {
hookMouse = ::SetWindowsHookEx(WH_MOUSE, (HOOKPROC)hookProcMouse, _hInst, 0); hookMouse = ::SetWindowsHookEx(WH_MOUSE, (HOOKPROC)hookProcMouse, _hInst, GetCurrentThreadId());
} }
else else
{ {
hookMouse = ::SetWindowsHookEx(WH_MOUSE_LL, (HOOKPROC)hookProcMouse, _hInst, 0); hookMouse = ::SetWindowsHookEx(WH_MOUSE_LL, (HOOKPROC)hookProcMouse, _hInst, GetCurrentThreadId());
} }
if (!hookMouse) if (!hookMouse)

View File

@ -258,11 +258,11 @@ void Gripper::create(void)
if (GetVersion() & 0x80000000) if (GetVersion() & 0x80000000)
{ {
hookMouse = ::SetWindowsHookEx(WH_MOUSE, (HOOKPROC)hookProcMouse, _hInst, 0); hookMouse = ::SetWindowsHookEx(WH_MOUSE, (HOOKPROC)hookProcMouse, _hInst, GetCurrentThreadId());
} }
else else
{ {
hookMouse = ::SetWindowsHookEx(WH_MOUSE_LL, (HOOKPROC)hookProcMouse, _hInst, 0); hookMouse = ::SetWindowsHookEx(WH_MOUSE_LL, (HOOKPROC)hookProcMouse, _hInst, GetCurrentThreadId());
} }
if (!hookMouse) if (!hookMouse)
@ -276,7 +276,7 @@ void Gripper::create(void)
winVer winVersion = (NppParameters::getInstance())->getWinVersion(); winVer winVersion = (NppParameters::getInstance())->getWinVersion();
if (winVersion < WV_VISTA) if (winVersion < WV_VISTA)
{ {
hookKeyboard = ::SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)hookProcKeyboard, _hInst, 0); hookKeyboard = ::SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)hookProcKeyboard, _hInst, GetCurrentThreadId());
if (!hookKeyboard) if (!hookKeyboard)
{ {
DWORD dwError = ::GetLastError(); DWORD dwError = ::GetLastError();

View File

@ -113,7 +113,7 @@ protected :
#define WH_MOUSE_LL 14 #define WH_MOUSE_LL 14
#endif #endif
winVer ver = (NppParameters::getInstance())->getWinVersion(); winVer ver = (NppParameters::getInstance())->getWinVersion();
_hHooker = ::SetWindowsHookEx(ver >= WV_W2K?WH_MOUSE_LL:WH_MOUSE, (HOOKPROC)hookProc, _hInst, 0); _hHooker = ::SetWindowsHookEx(ver >= WV_W2K?WH_MOUSE_LL:WH_MOUSE, (HOOKPROC)hookProc, _hInst, GetCurrentThreadId());
hook = _hHooker; hook = _hHooker;
return FALSE; return FALSE;
} }