Delphi 修正EmbeddedWEB不能使用中键滚动的bug

来源:互联网 发布:淘宝无限流量手机骗局 编辑:程序博客网 时间:2024/05/17 03:10

Modified : /EmbeddedWB/EmbeddedWB.pas


{$IFDEF Enable_MouseWheelFix}function MouseHookProc(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;var  hwnd: THANDLE;  WndClass: string;begin  Result := CallNextHookEx(MouseHook, nCode, wParam, lParam);  case nCode < 0 of    TRUE: Exit;    FALSE:      begin        if (wParam = WM_MOUSEWHEEL) then        begin          hwnd := WindowFromPoint(Mouse.CursorPos);          if hwnd <> 0 then          begin           //hwnd := GetParent(hwnd); ///屏蔽这一句后正常            if hwnd <> 0 then            begin              SetLength(WndClass, 25);              SetLength(WndClass, GetClassName(hwnd, PChar(WndClass), Length(WndClass)));              if WndClass = 'Shell DocObject View' then                Windows.SetFocus(hwnd);            end;          end;        end;      end;  end;end;{$ENDIF}


原创粉丝点击