Lej Posted January 27, 2007 Share Posted January 27, 2007 Is it possible to use mwheelup and mwheeldown as hotkeys? Can't find anything in HotKeySet() or _IsPressed() :/ Link to comment Share on other sites More sharing options...
BrettF Posted January 27, 2007 Share Posted January 27, 2007 Try ThisIt should be what your looking for. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
BrettF Posted January 27, 2007 Share Posted January 27, 2007 Try this: Its a snippit from the Mouse Hook by Larry. Get it in the above post, Const $WH_MOUSE = 7 $gui = GUICreate("test") Global $n,$buffer = "" Const $WM_AUTOITMOUSEWHEELUP = 0x1400 + 0x0D30 Const $WM_AUTOITMOUSEWHEELDOWN = 0x1400 + 0x0D31 GUIRegisterMsg($WM_AUTOITMOUSEWHEELUP,"MouseWheelUp") GUIRegisterMsg($WM_AUTOITMOUSEWHEELDOWN,"MouseWheelDown") Global $DLLinst = DLLCall("kernel32.dll","hwnd","LoadLibrary","str",".\hook.dll") Global $mouseHOOKproc = DLLCall("kernel32.dll","hwnd","GetProcAddress","hwnd",$DLLInst[0],"str","MouseProc") Global $hhMouse = DLLCall("user32.dll","hwnd","SetWindowsHookEx","int",$WH_MOUSE, _ "hwnd",$mouseHOOKproc[0],"hwnd",$DLLinst[0],"int",0) DLLCall(".\hook.dll","int","SetValuesMouse","hwnd",$gui,"hwnd",$hhMouse[0]) Func MouseWheelDown($hWndGUI, $MsgID, $WParam, $LParam) $n += 1 If $n > 25 Then $n = 25 $buffer = StringTrimLeft($buffer,StringInStr($buffer,@LF)) EndIf $buffer &= "Mouse: " & $MsgID & "," & $WParam & "," & $LParam & @LF ToolTip($buffer) EndFunc Func MouseWheelUp($hWndGUI, $MsgID, $WParam, $LParam) EndFunc While 1 $msg = GUIGetMsg() If $msg = -3 Then ExitLoop WEnd Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Lej Posted January 27, 2007 Author Share Posted January 27, 2007 Yes, this seems to be exaclty what I needed. Wondering about one thing tho: Func MouseWheelDown($hWndGUI, $MsgID, $WParam, $LParam) $n += 1 If $n > 25 Then $n = 25 $buffer = StringTrimLeft($buffer,StringInStr($buffer,@LF)) EndIf $buffer &= "Mouse: " & $MsgID & "," & $WParam & "," & $LParam & @LF ToolTip($buffer) EndFunc Is the stuff in the function just for showing? When i make my program it can be removed without causing troubles and I just add my code? Link to comment Share on other sites More sharing options...
BrettF Posted January 27, 2007 Share Posted January 27, 2007 Yes, this seems to be exaclty what I needed. Wondering about one thing tho: Func MouseWheelDown($hWndGUI, $MsgID, $WParam, $LParam) $n += 1 If $n > 25 Then $n = 25 $buffer = StringTrimLeft($buffer,StringInStr($buffer,@LF)) EndIf $buffer &= "Mouse: " & $MsgID & "," & $WParam & "," & $LParam & @LF ToolTip($buffer) EndFunc Is the stuff in the function just for showing? When i make my program it can be removed without causing troubles and I just add my code? Yes it was just for showing. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now