Jump to content

MouseGetCursor


Guest <J>
 Share

Recommended Posts

Hi *.

I have to write a script that mentions if the mouse cursor (inside an application) is changing.

Unfortunatly "MouseGetCursor" returns ID 0 (Unknown) for both cursors.

--> Can't use "MouseGetCursor"

"PixelGetColor" is not able to get the color from a pixel of a mouse cursor icon. It always returns the color code of the underneath pixel.

--> Can't use "PixelGetColor"

Even examining a screenshot is not that easy, cause Windows clipboard screenshots and Lazycats DLL are not showing the mouse cursor.

--> Can't examine screenshot.

Help i am stuck. I am pretty sure the problem is, that i have too little knowlege of AutoIt. I already searched the forum and found a similar question but no detailed answer. There must be an _easy_ way to do this, without having another thousand lines of code in my script.

Thanks in advance.

Ciao, J.

Link to comment
Share on other sites

Hi,

Did u try this example ?

sleep(2000) ;allow time to move mouse before reporting ID

;create an array that tells us the meaning of an ID Number
$IDs = StringSplit("AppStarting|Arrow|Cross|Help|IBeam|Icon|No|_
Size|SizeAll|SizeNESW|SizeNS|SizeNWSE|SizeWE|UpArrow|Wait", "|")
$IDs[0] = "Unknown"

$cursor = MouseGetCursor()
MsgBox(4096, "ID = " & $cursor, "Which means " & $IDs[$cursor])

Works fine here.

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to comment
Share on other sites

Unfortunatly "MouseGetCursor" returns ID 0 (Unknown) for both cursors.

It returns Zero (Unkown) for both cursors (the cursors are non standard).

Edited by <J>
Link to comment
Share on other sites

perhaps an stupid question, why monitor the mouse cursor ?

Is there something else to monitor to do what u want ?

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to comment
Share on other sites

The background is dynamic, that means the color of the pixels are changing. I can not identify this region by another event than the cursor change. :lmao:

Link to comment
Share on other sites

and what about this ?

PixelChecksum

--------------------------------------------------------------------------------

Generates a checksum for a region of pixels.

PixelChecksum ( left, top, right, bottom [, step] )

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to comment
Share on other sites

"PixelChecksum" (like "PixelGetColor") disregards the mouse icon pixel colors and only checksum the pixel colors underneath the mouse cursor icon. Additonally "PixelChecksum" is checking all pixels within an rectangle, that would include some pixels of the "dynamic" background, wich will lead to a permanently changing checksum.

Imagine: A full screen video with clickable areas at alternating coordinates. These areas could only be identified by a cursor change from a "X"-Symbol to a "Hand"-Symbol.

Edited by <J>
Link to comment
Share on other sites

  • 1 year later...

It returns Zero (Unkown) for both cursors (the cursors are non standard).

im looking for the same thing

the cursors r non standard and gives ID 0

so how to detect the cursor changed , is it possible with autoit if it r non standard cursors ?

Link to comment
Share on other sites

HI,

maybe you could use the position of the cursor to identify whether it changes. I think, I changes at a specific position. Or you could change the cursor when you want to.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

HI,

maybe you could use the position of the cursor to identify whether it changes. I think, I changes at a specific position. Or you could change the cursor when you want to.

So long,

Mega

nope doesnt work position stays the same after cursor changed, good idea though, didnt had any left to try :D

Edited by neger
Link to comment
Share on other sites

  • 2 years later...

Looks like I'm digging up a pretty old thread, but I'm running into the same issues. Wasnt able to find a solution searching around. Are there any new ways to detect a change or different color of the mousecursor when MouseGetCursor always returns 0, and pixelgetcolor ignores the mouse cursor?

Edited by eden
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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