能把鼠标滚轮作为热键吗
鼠标滚轮能作为热键吗?能滚动或按下就执行某个函数吗?本人新手,望告知。 在官方的论坛找的,这个脚本能让你滚动滚轮时出现msgbox,持续5秒http://www.autoitscript.com/forum/index.php?showtopic=64738
#include <MouseSetOnEvent_UDF.au3>
_MouseSetOnEvent ($MOUSE_WHELLSCROLL_EVENT,'fuck')
sleep(5000)
_MouseSetOnEvent ($MOUSE_WHELLSCROLL_EVENT)
func fuck()
msgbox(0,'fuck...','u!',1)
endfunc 楼上的我试了下不行啊 估计楼主的失败在于没有MouseSetOnEvent_UDF.au3这个UDF而已。
我也没有这个UDF,呵呵。 http://www.autoitscript.com/forum/index.php?s=23c4a4459d59ff89543e4e40c509900c&act=attach&type=post&id=19588 原帖由 phdzh 于 2008-6-14 12:40 发表 http://www.autoitx.com/images/common/back.gif
楼上的我试了下不行啊
我行!
我能! 系统事件模式的:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$WM_MOUSEWHEEL=0x020A
$Form1 = GUICreate("Form1", 348, 166, 320, 125)
GUIRegisterMsg ($WM_MOUSEWHEEL, "WM_MOUSEWHEEL" )
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func WM_MOUSEWHEEL($hWndGUI, $MsgID, $WParam, $LParam)
If $hWndGUI=$Form1 Then MsgBox(0,"","您转动了鼠标.")
EndFunc 今天正好写这么个程序,试用了几次不成功,请问一下高手,$WM_MOUSEWHEEL必须要在指定的窗体上运行才行啊? WM_MOUSEWHEEL 是滚轮消息 只要滚轮滚了 就产生这个消息
如果你要限定在某个窗口 就判断下鼠标是否在当前窗口范围中 谢谢你的热心帮助! 顶一个,谢谢分享,学习了 实用性很强 收藏了 官方的
#include <MouseSetOnEvent_UDF.au3>
;Disable Primary mouse button *down*, and call our function when mouse button *down* event is recieved
_MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "MousePrimaryDown_Event")
Sleep(5000)
_MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT) ;Enable mouse button back.
MsgBox(64, "Attention!", "Now we disable Secondary mouse button up, and call our function when mouse button up event is recieved.", 5)
;Disable Secondary mouse button *up*, and call our function when mouse button *up* event is recieved
_MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT, "MouseSecondaryUp_Event")
Sleep(5000)
_MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT) ;Enable mouse button back.
Func MousePrimaryDown_Event()
ConsoleWrite("Primary Mouse Down" & @LF)
EndFunc
Func MouseSecondaryUp_Event()
ConsoleWrite("Secondar Mouse Up" & @LF)
EndFunc MouseSetOnEvent
good
页:
[1]