C
coolzew
Unregistered / Unconfirmed
GUEST, unregistred user!
望高手指教,如何才能判断滚轮滚动的方向
function InternalMouseHookCallBack(Code:Integer;Msg:WPARAM;MouseHook:LPARAM):LongInt;stdcall;
var
pMHS : PMOUSEHOOKSTRUCT;
begin
pMHS := PMOUSEHOOKSTRUCT(MouseHook);
if (Msg = WM_MOUSEWHEEL) and (pMHS.hwnd = FViewHandle) then
begin
[blue]PostMessage(FViewHandle,WM_VSCROLL, SB_LINEUP,0);[/blue]
// 我现在不知道滚轮滚动的方向所以不知何时该调用
//PostMessage(FViewHandle,WM_VSCROLL, [red]SB_LINEDOWN[/red],0);
end;
Result := CallNextHookEx(whMouse,Code,Msg,MouseHook);
end;
//钩子的创建过程如下:
whMouse := SetWindowsHookEx(WH_MOUSE,InternalMouseHookCallback,0,GetCurrentThreadID);
function InternalMouseHookCallBack(Code:Integer;Msg:WPARAM;MouseHook:LPARAM):LongInt;stdcall;
var
pMHS : PMOUSEHOOKSTRUCT;
begin
pMHS := PMOUSEHOOKSTRUCT(MouseHook);
if (Msg = WM_MOUSEWHEEL) and (pMHS.hwnd = FViewHandle) then
begin
[blue]PostMessage(FViewHandle,WM_VSCROLL, SB_LINEUP,0);[/blue]
// 我现在不知道滚轮滚动的方向所以不知何时该调用
//PostMessage(FViewHandle,WM_VSCROLL, [red]SB_LINEDOWN[/red],0);
end;
Result := CallNextHookEx(whMouse,Code,Msg,MouseHook);
end;
//钩子的创建过程如下:
whMouse := SetWindowsHookEx(WH_MOUSE,InternalMouseHookCallback,0,GetCurrentThreadID);