鼠标滚轮滚动鼠标下的窗口,在win8.1下遇到问题,求助

遇到了问题?请先进行搜索(中文和英文),然后在此提问

Moderators: tmplinshi, arcticir

aamii
Posts: 47
Joined: 23 May 2014, 03:50

鼠标滚轮滚动鼠标下的窗口,在win8.1下遇到问题,求助

02 Jul 2015, 07:49

下面这段代码,可用于“滚动当前窗口下的滚动条”(不用激活窗口)

以前在win7(32位)+Ahk32_Unicode 下面,操作稳定。

Code: Select all

; win7(32),Ahk(32 Unicode)
coordmode,Mouse,screen
WheelUp::
WheelDown::
   MouseWheelSetp:=(A_ThisHotkey="WheelUp") ? 120 : -120
   MouseGetPos, MWAW_x, MWAW_y
   MWAW_Hwnd := DllCall( "WindowFromPoint", "int", MWAW_x, "int", MWAW_y )
   SendMessage, 0x20A, MouseWheelSetp << 16, ( MWAW_y << 16 )|MWAW_x,, ahk_id %MWAW_Hwnd%
   return
转移到Win8.1(64位)+Ahk64_unicode下,不能用,改成

Code: Select all

coordmode,Mouse,screen
WheelUp::
WheelDown::
   MouseWheelSetp:=(A_ThisHotkey="WheelUp") ? 120 : -120
   MouseGetPos, MWAW_x, MWAW_y,MWAW_win
   SendMessage, 0x20A, MouseWheelSetp << 16, ( MWAW_y << 16 )|MWAW_x,, ahk_id %MWAW_win%
   return
部分窗口有效,无效的窗口当然即使在激活状态也不能滚动了。

能修改到能用么?
aamii
Posts: 47
Joined: 23 May 2014, 03:50

Re: 鼠标滚轮滚动鼠标下的窗口,在win8.1下遇到问题,求助

29 Jul 2015, 09:27

在老网上找到了这个答案

Code: Select all

WheelUp::
WheelDown::
Wheel()
return

Wheel()
{
	CoordMode, Mouse, Screen
	MouseGetPos, MouseX, MouseY
	DllCall("SendMessage","PTR",DllCall( "WindowFromPoint", "INT64", MouseX | (MouseY << 32), "Ptr"),"UInt", 0x20A, "PTR",(120 * (A_ThisHotkey = "WheelUp" ? 1 : -1)) << 16,"PTR", ( MouseY << 16 )|MouseX)
	return
}

Return to “请求帮助”

Who is online

Users browsing this forum: No registered users and 44 guests