PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

WinAPI function MouseScroll doesnt work

Open MikeKholomeev opened this issue 4 years ago • 8 comments

Microsoft PowerToys version

0.47.1

Running as admin

  • [X] Yes

Area(s) with issue?

General, Awake, ColorPicker, FancyZones, FancyZones Editor, Image Resizer, Keyboard Manager, PowerRename, PowerToys Run, Settings

Steps to reproduce

Use app that sends WinAPI function to the specific window. In my case - it is AutoHotkey language script.

command (DocsMicrosoft link) SendMessage, 0x20A, "WheelUp", (mY<<16)|mX,, ahk_id %WinID%

, where 0x20A = WM_MOUSEWHEEL WinID = windows ID (handle)

I think it was working prion 0.47 version.

✔️ Expected Behavior

Should scroll content in PowerToys UI

❌ Actual Behavior

does nothin

Other Software

AutoHotkey v1.1.32.00

#Singleinstance force
#MaxHotkeysPerInterval 800
#InstallKeybdHook
#InstallMouseHook
#NoEnv         
SendMode Input
SetTitleMatchMode, 2 

TaskBarID := WinExist("ahk_class Shell_TrayWnd")

WheelUp::  ; Volume Control by mouseweel rotation on TaskBar
    MouseGetPos,,,Hwnd
    WinGetClass, Up_Down_Win_Class, ahk_id %Hwnd% ; get window class under mouse cursor

    If Up_Down_Win_Class in Windows.UI.Core.CoreWindow,ApplicationFrameWindow
	; if it is "Start" button
	{
		Send, {WheelUp}
		Return ; finish hotkey
	}
  If(Hwnd = TaskBarID)
    {
	SoundSet, +5
	GoSub, Show_Sound
	}
  Else
    Goto, All_Up_Down
Return

WheelDown::  ; Volume Control by mouseweel rotation on TaskBar
    MouseGetPos,,,Hwnd
    WinGetClass, Up_Down_Win_Class, ahk_id %Hwnd% ; get window class under mouse cursor

    If Up_Down_Win_Class in Windows.UI.Core.CoreWindow,ApplicationFrameWindow 
	; if it is "Start" button
	{
		Send, {WheelDown}
		Return 
	}
  If(Hwnd = TaskBarID)
    {
	SoundSet, -5
	GoSub, Show_Sound
	}
  Else
    Goto, All_Up_Down
Return

Show_Sound:
return

All_Up_Down: ; Scrolling content in the window under the mouse pointer, instead of the active window.
    Critical
    If(A_ThisHotkey!=A_PriorHotkey || A_TimeSincePriorHotkey>40) 
        Scroll:= A_ThisHotkey="WheelUp" ? 120<<16 : -120<<16   
    Else                                                        
        Scroll:= A_ThisHotkey="WheelUp" ? 240<<16 : -240<<16    

    CoordMode, Mouse, Screen
    MouseGetPos, mX, mY
    mX &= 0x00000000FFFFFFFF
    Point := mX | mY<<32
    WinID:=DllCall("WindowFromPoint", "int64", Point, "ptr")   ; ID (handle) 
    Point := mX | (mY-20)<<32                                  
    NextID:=DllCall("WindowFromPoint", "int64", Point, "ptr")
    mX &= 0x0000FFFF
    SendMessage, 0x20A, %Scroll%, (mY<<16)|mX,, ahk_id %WinID%   ; 0x20A = WM_MOUSEWHEEL
    If (!ErrorLevel && (WinID != NextID))
        SendMessage, 0x20A, %Scroll%, (mY<<16)|mX,, ahk_id %NextID%
Return

MikeKholomeev avatar Oct 12 '21 22:10 MikeKholomeev

Do you have X-Mouse Button Control running? or something simular?

crutkas avatar Dec 27 '21 17:12 crutkas

Also which exact items are not working

crutkas avatar Dec 27 '21 17:12 crutkas

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 5 days. It will be closed if no further activity occurs within 5 days of this comment.

ghost avatar Jan 02 '22 02:01 ghost

Do you have X-Mouse Button Control running? or something simular?

Hi! I've tried two tools - the first is written above AHK script, the second is an application MouseImp (https://www.mouseimp.com/download/ . It hooks scrolling on the right mouse button, so you can perform scrolling by press&hold RMB and moving mouse up/down).

As a result - I switched off the AHK script, and can give feedback only relying on MouseImp use.

Feedback:

  • Standart Windows 10 option "Scroll content in windows under cursor" works
  • MouseImp does not work in PowerToys 0.51.1 Settings window

Prerequisite:

  • install MouseImp
  • add to the file C:\Program Files\Mouse Imp (64 bit)\mimpwnds.xml lines
		<!-- PowerToys  -->
	<item wndclass="HwndWrapper[PowerToys" horscroll="false" lockedscrolldirection="true" lockedwheeldelta="true" />	

  • restart MouseImp

wndclass="HwndWrapper[PowerToys" is the name of the class of the PowerToys 0.51.1 Settings window. The name should not match exactly. It matches by the first symbols

MikeKholomeev avatar Jan 03 '22 09:01 MikeKholomeev

Is this still an issue?

Jay-o-Way avatar Sep 17 '22 12:09 Jay-o-Way

Yes.

...I can shoot a screen video for understanding.

MikeKholomeev avatar Sep 17 '22 12:09 MikeKholomeev

But, my issue is not with XMouseButtonControl app, my issue is with the application MouseImp (https://www.mouseimp.com/download/ . It hooks scrolling to the right mouse button, so you can perform scrolling by press&hold RMB and moving the mouse up/down).

MikeKholomeev avatar Sep 17 '22 16:09 MikeKholomeev

Asking around again here. @gabbybilka fyi

crutkas avatar Sep 19 '22 20:09 crutkas

Copy-paste comment from @nandoputrap:

Hi! The issue also come after updating Firefox 110. I found the solution here: https://techdows.com/2023/02/fix-mouse-wheel-scrolling-not-working-firefox.html

It works on me. I also can scroll on some apps like Power Toys and Files

Summary: Disable / Uncheck this setting on XMBC

image

Jay-o-Way avatar Feb 16 '23 09:02 Jay-o-Way

Thank you for the suggestion, but my app doesn't have the setting :(

MikeKholomeev avatar Feb 16 '23 12:02 MikeKholomeev

Moving my comment at https://github.com/microsoft/PowerToys/issues/23212#issuecomment-1661109983 here.

My scroll wheel does nothing when PowerToys settings, Peek, or possibly other components too are foreground. Not even trying to scroll a background window (“Scroll inactive windows when hovering over them” has always been on, so #20961 would not apply).

My trackpad is not affected. The difference is that the mouse has a driver which I use to rebind buttons, hence it’s similar to this issue.

This also affects Task Manager and RegEdit, hinting that it’s an issue in the underneath UI library. In contrast, Windows Explorer, Settings and Terminal are not affected.

ParadoxV5 avatar Aug 03 '23 20:08 ParadoxV5