Jump to content

Recommended Posts

Posted

So when i press V + scroll up or down, it works, and i get confirmation by console,

but if i click the gui, it just crashes, if i disable the mouse function, it doesn't crash, what should i do?

#include <misc.au3>
#include <WindowsConstants.au3>
#include <MouseOnEvent.au3>
#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)
Local $hDLL = DllOpen("user32.dll")
$GUI = GUICreate("GUI Test", 200, 100, 100, 100, -1, $WS_EX_ACCEPTFILES)
GUISetOnEvent($GUI_EVENT_CLOSE, "Quit")
GUISetState()

_MouseSetOnEvent($MOUSE_WHEELSCROLLUP_EVENT, "_MouseWheelUP")
_MouseSetOnEvent($MOUSE_WHEELSCROLLDOWN_EVENT, "_MouseWheelDN")

;=============================================================================

Func _MouseWheelUP($iEvent)
    If _IsPressed("56") Then ;V
        ConsoleWrite('UP' & @CRLF)
    EndIf
EndFunc   ;==>_MouseWheelUP

;=============================================================================

Func _MouseWheelDN($iEvent)
    If _IsPressed("56") Then ;V
        ConsoleWrite('DN' & @CRLF)
    EndIf
EndFunc   ;==>_MouseWheelDN

;=============================================================================

While 1
    Sleep(15)
WEnd

Func Quit()
    Exit
EndFunc
  Reveal hidden contents

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted (edited)

Unfortunately, it works fine for me.

Edit: Try to figure out where it crashes, it will give some hints to solve the problem.

Edited by FireFox
Posted

If I had to guess...64-bit machine with 64-bit version of AutoIt. See my comment in that thread.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Hmm.. is there an alternative to detect mouse scroll?

  Reveal hidden contents

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted

On the GUI? Yes, try a search for WM_MOUSE...

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

I would like the script to detect wheel scroll even when minimized or hidden.

  Reveal hidden contents

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted

That UDF is what you want, but it needs re-tweaking.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

I use but I'm pretty sure it only works on the GUI itself.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

That won't cut it, i need it to detect also outside of the gui. Should i post this issue in the udf topic? Maybe Mr. Creator can help me out.

  Reveal hidden contents

IUIAutomation - Topic with framework and examples

Au3Record.exe

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...