ArminLinder Posted January 21, 2019 Posted January 21, 2019 (edited) I have a quite nagging problem. Unfortunately the code is quite long, so posting a sample is not possible right now, but I think those who know will understand anyway. I have a two component script. Component 1 utilizes a global mouse hook to monitor mouse clicks sent to a specific app. It displays the coordinates of any click in a listview. This code works well. Now I thought it would be nice - for checking coordinates - to be able to click on a corrdinate in the listview and have the mouse repeat the click right at the spot where it was recorded. I added a WM_NOTIFY event handler which fires whenever one clicks a row in the listview, reads the coordinates of the clicked entry and repeats a click at the very same spot. Works too. Unfortunately both together cause an unwanted loop: the simulated mouse click bounces back and enters my monitoring component, creating a new entry. This is what I tried so far: - added a flag before I replay a click, and reset it right afterwards. While the flag is set, the recorder does not record any events. Doesn't work, seems the two event handlers don't multi-task, but the incoming clicks get queued and added to the list later. - cleared the mouse hook before sending, intending to re-establish it after the send operation. Doing so crashes my script immedately. Any thoughts how I can achieve what I want? Can I, for instance, attach a flag of my own to the mouse click so my recorder can recognize it's own clicks and skip them? Thx, Armin. Edited January 21, 2019 by ArminLinder
dmob Posted January 21, 2019 Posted January 21, 2019 1 hour ago, ArminLinder said: attach a flag of my own to the mouse click so my recorder can recognize it's own clicks and skip them? Seems you already have the solution...?
ArminLinder Posted January 22, 2019 Author Posted January 22, 2019 (edited) 17 hours ago, dmob said: Seems you already have the solution...? Not quite ... can one indeed attach custom attributes to mouse click commands? If yes, can you guide me to a sample where I can see how it needs to be programmed? Greetz, Armin. Edited January 22, 2019 by ArminLinder
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