如何在Windows 7上使用鼠标滚轮滚动OneNote中的笔记列表?

用户名

通常,当您使用滚动条在列表内移动光标时,鼠标滚轮会滚动该列表。但是,在OneNote中,当光标肯定在注释列表内(本图中的蓝色区域)时,我只能滚动注释页面本身:

花哨的gif,如果您没有看到它,那是很可惜的

页面是否可以滚动似乎并不重要,当鼠标位于蓝色区域内时,鼠标滚轮不会滚动注释列表。我只能通过使用鼠标左键与滚动条进行交互来滚动它。

It appears to be the issue with Windows 7 (maybe it's the OS, or maybe OneNote version for 7 has this bug). Windows 10 doesn't seem to have this problem at all.

user1306322

New, much simpler solution using AutoHotKey

I've been looking for a way to avoid freezes caused by constant checks for the active window and also an overall simpler code solution. Here's what I made:

#ifWinActive ahk_class Framework::CFrame
    WheelUp::
        ControlGetFocus, control, A
        Loop 3
        SendMessage, 0x115, 0, 0, %control%, A
    Return

#ifWinActive ahk_class Framework::CFrame
    WheelDown::
        ControlGetFocus, control, A
        Loop 3
        SendMessage, 0x115, 1, 0, %control%, A
    Return

Change the Loop 3 to Loop 5 or however many lines you wish for one movement of the wheel to scroll.


old solution using AutoIt

Note: this solution may cause stuttering and occasional freezes on older CPUs or at full CPU load.

我启动了一个AutoIt脚本,该脚本可检测注释列表区域内的光标,并且如果您向上或向下滚动,请在滚动条上单击“向上”和“向下”按钮。这适用于多个OneNote窗口。您无需专注于窗口即可使滚动工作,只需将鼠标悬停在该列表上即可:

#include <AutoItConstants.au3>
#include <MsgBoxConstants.au3>
#include <MouseOnEvent.au3> ; get it from https://www.autoitscript.com/forum/topic/64738-mouseonevent-udf/
#include <WinAPI.au3>
#include <Misc.au3>

_MouseSetOnEvent($MOUSE_WHEELSCROLLUP_EVENT, 'MouseWUp')
_MouseSetOnEvent($MOUSE_WHEELSCROLLDOWN_EVENT, 'MouseWDown')
Opt("WinTitleMatchMode", 2) ; 2 - substring mode

Global $clicks = 3 ; how many items to scroll per scroll, change this to 5, 8, 13, 42 or however fast you wanna scroll

Func MouseWUp($iEvent)
  If StringInStr(WinGetTitle($hWin), " - OneNote") Then

      ; check if cursor is within the notes list and not anywhere else
      Local $cur = MouseGetPos()
      Local $handle = $hWin ;WinGetHandle("[ACTIVE]")
      Local $wpos = WinGetPos($handle) ; returna array of x,y,w,h
      Local $cpos = ControlGetPos ($handle, "", "[CLASS:NetUIHWND; INSTANCE:5]")
      ;MsgBox($MB_SYSTEMMODAL, "title", "win2:" & $wpos[2] & "; win3:" & $wpos[3] & "; cp2:" & $cpos[2] & "; cp3:" & $cpos[3])

      If ($cur[0] > $wpos[0] + $wpos[2] - $cpos[2]) And ($cur[0] < $wpos[0] + $wpos[2]) Then

         Local $x = $cpos[2] - 2
         Local $y = 58
         ControlClick($handle, "", "[CLASS:NetUIHWND; INSTANCE:5]", "left", $clicks, $x, $y)

      EndIf

   EndIf
EndFunc

Func MouseWDown($iEvent)
   If StringInStr(WinGetTitle($hWin), " - OneNote") Then

      Local $cur = MouseGetPos()
      Local $handle = $hWin ;WinGetHandle("[ACTIVE]")
      Local $wpos = WinGetPos($handle)
      Local $cpos = ControlGetPos ($handle, "", "[CLASS:NetUIHWND; INSTANCE:5]")

      If ($cur[0] > $wpos[0] + $wpos[2] - $cpos[2]) And ($cur[0] < $wpos[0] + $wpos[2]) Then

         Local $x = $cpos[2] - 2
         Local $y = $cpos[3] - 8
         ControlClick($handle, "", "[CLASS:NetUIHWND; INSTANCE:5]", "left", $clicks, $x, $y)

      EndIf
   EndIf
EndFunc

; https://stackoverflow.com/a/11270659
Func _WindowFromPoint($iX,$iY)
    Local $stInt64,$aRet,$stPoint=DllStructCreate("long;long")
    DllStructSetData($stPoint,1,$iX)
    DllStructSetData($stPoint,2,$iY)
    $stInt64=DllStructCreate("int64",DllStructGetPtr($stPoint))
    $aRet=DllCall("user32.dll","hwnd","WindowFromPoint","int64",DllStructGetData($stInt64,1))
    If @error Then Return SetError(2,@error,0)
    If $aRet[0]=0 Then Return SetError(3,0,0)
    Return $aRet[0]
EndFunc

Local $hControl, $hWin, $hOldWin, $aMousePos
$hOldWin = ""
While True ;Not _IsPressed("1B")
    $aMousePos = MouseGetPos()
    $hControl=_WindowFromPoint($aMousePos[0],$aMousePos[1])
    ; Since _WindowFromPoint() can return 'sub' windows, or control handles, we should seek the owner window
    $hWin=_WinAPI_GetAncestor($hControl,2)
    If $hWin <> $hOldWin Then
        ;TrayTip("Window Info","Window under mouse = " & WinGetTitle($hWin), 1)
        $hOldWin = $hWin
    EndIf
    Sleep(10)
WEnd

我还没有弄清楚如何防止滚动影响笔记页面本身。如果有人找到了阻止滚动事件从注释列表区域内到达主要注释区域的方法,请分享您的解决方案,以便我们结合使用脚本以达到最佳效果。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何使用鼠标滚轮在scrollviewer中滚动列表框

来自分类Dev

如何在 angular 上使用鼠标滚轮滚动到项目

来自分类Dev

如何在SWT中使用鼠标滚轮滚动滚动的合成

来自分类Dev

如何让鼠标滚轮在zsh上滚动屏幕?

来自分类Dev

如何在TDBCtrlGrid上启用鼠标滚轮滚动?

来自分类Dev

如何在Ubuntu 11.04或10.10中禁用鼠标滚轮滚动?

来自分类Dev

如何在Ubuntu 11.04或10.10中禁用鼠标滚轮滚动?

来自分类Dev

如何在Windows 7中使鼠标滚轮按钮执行双击?

来自分类Dev

如何在 Windows Vista 中禁用鼠标滚轮

来自分类Dev

如何在Windows 7中禁用滚轮鼠标按钮,以使其不显示任务切换器

来自分类Dev

如何在Flutter MacOS中为ListView禁用拖动滚动但保持鼠标滚轮滚动?

来自分类Dev

防止在Windows窗体中使用鼠标滚轮滚动

来自分类Dev

如何使鼠标滚轮滚动到mediafire.com中的部分

来自分类Dev

如何使用键盘通过AutoHotkey模拟鼠标滚轮滚动?

来自分类Dev

如何使用鼠标滚轮滚动线性动画 div?

来自分类Dev

如何在Win 8 Hyper-V中运行的Ubuntu 12.10中启用鼠标滚轮滚动?

来自分类Dev

如何在TcxComboBox中抑制鼠标滚轮

来自分类Dev

如何在Chrome中启用鼠标滚轮?

来自分类Dev

如何在TcxComboBox中抑制鼠标滚轮

来自分类Dev

如何在LibGDX中使用鼠标滚轮?

来自分类Dev

如何在Sublime Text 3中更改鼠标滚轮滚动速度?

来自分类Dev

如何在Windows上抓住鼠标

来自分类Dev

如何在jQuery中计算鼠标滚轮滚动

来自分类Dev

如何在Windows 7上使用笔记本电脑命令磁盘存放

来自分类Dev

如何在Windows 7中加快滚动速度?

来自分类Dev

如何在Windows 7中关闭“自动滚动”

来自分类Dev

如何在Windows窗体中禁用NumericUpDown上的滚动

来自分类Dev

如何在Windows 7上安装Pygame?

来自分类Dev

如何在Windows 7上安装Angular

Related 相关文章

  1. 1

    如何使用鼠标滚轮在scrollviewer中滚动列表框

  2. 2

    如何在 angular 上使用鼠标滚轮滚动到项目

  3. 3

    如何在SWT中使用鼠标滚轮滚动滚动的合成

  4. 4

    如何让鼠标滚轮在zsh上滚动屏幕?

  5. 5

    如何在TDBCtrlGrid上启用鼠标滚轮滚动?

  6. 6

    如何在Ubuntu 11.04或10.10中禁用鼠标滚轮滚动?

  7. 7

    如何在Ubuntu 11.04或10.10中禁用鼠标滚轮滚动?

  8. 8

    如何在Windows 7中使鼠标滚轮按钮执行双击?

  9. 9

    如何在 Windows Vista 中禁用鼠标滚轮

  10. 10

    如何在Windows 7中禁用滚轮鼠标按钮,以使其不显示任务切换器

  11. 11

    如何在Flutter MacOS中为ListView禁用拖动滚动但保持鼠标滚轮滚动?

  12. 12

    防止在Windows窗体中使用鼠标滚轮滚动

  13. 13

    如何使鼠标滚轮滚动到mediafire.com中的部分

  14. 14

    如何使用键盘通过AutoHotkey模拟鼠标滚轮滚动?

  15. 15

    如何使用鼠标滚轮滚动线性动画 div?

  16. 16

    如何在Win 8 Hyper-V中运行的Ubuntu 12.10中启用鼠标滚轮滚动?

  17. 17

    如何在TcxComboBox中抑制鼠标滚轮

  18. 18

    如何在Chrome中启用鼠标滚轮?

  19. 19

    如何在TcxComboBox中抑制鼠标滚轮

  20. 20

    如何在LibGDX中使用鼠标滚轮?

  21. 21

    如何在Sublime Text 3中更改鼠标滚轮滚动速度?

  22. 22

    如何在Windows上抓住鼠标

  23. 23

    如何在jQuery中计算鼠标滚轮滚动

  24. 24

    如何在Windows 7上使用笔记本电脑命令磁盘存放

  25. 25

    如何在Windows 7中加快滚动速度?

  26. 26

    如何在Windows 7中关闭“自动滚动”

  27. 27

    如何在Windows窗体中禁用NumericUpDown上的滚动

  28. 28

    如何在Windows 7上安装Pygame?

  29. 29

    如何在Windows 7上安装Angular

热门标签

归档