Sign in to follow this  
Followers 0
BitRot

Change the mouse-cursor appearance

7 posts in this topic

Hello All,

I'm currently trying to change the mouse-cursor to something else than the standard arrow, depending on certain conditions.

Currently I load the mouse-cursor I want, using User32.dll's "LoadCursorA" function, and than apply it by using "SetCursor" function.

The problem is that whenever I move the mouse its appearance gets set back to the standard arrow. An attempt to set the arrows appearance in every step results in annoying flickering between both the origional and the desired one.

Has anyone got an idea how to change the mouse-cursor (that does not result in such a flicker) ?

Share this post


Link to post
Share on other sites



I'm not sure I follow you but is this what your after?

From the help file

GUISetCursor ( [cursorID [, override [, winhandle]]] )

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I'm not sure I follow you but is this what your after?

From the help file

GUISetCursor ( [cursorID [, override [, winhandle]]] )
Grrr.... :P Yes, that pretty-much looks like it. I must have seen, but not recognised it. I did find the "MouseGetCursor", but not "MouseSetCursor", nor was the above command mentioned in the "related" section. :)

Any chance that I can use other cursor ID's than the 16 named there ? Currently I'm using cursor-ID's 32654 thru 32662, the scroll-images that appear when you press the middle mouse-button in a document. I like to have those single-direction pointers, instead of the default double-directions Windows (and therefore AutoIt) offers.

Edited by BitRot

Share this post


Link to post
Share on other sites

Supose you can load your own cursors and set those (I could in VB6 so why not in AutoIt?). I don't recal how it was done thought (but it was through th ewindows API) :)

Share this post


Link to post
Share on other sites

Supose you can load your own cursors and set those (I could in VB6 so why not in AutoIt?). I don't recal how it was done thought

I've got no problem loading those cursors (allready did that). The current problem is that AI's cursor-settings only go from 0 to 16, and do not seem to accept any other values (I allready tried).

Setting those loaded cursors by way of a DLL-function causes them to battle with AI's own cursor, with the beforementioned flickering as a result.

Share this post


Link to post
Share on other sites

<snip code>

Sneaky ! First setting your own cursor, and than simply ignore any requests that attempt to change it. I don't think I would have ever thought of a solution like that. :)

Thanks.

Share this post


Link to post
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
Sign in to follow this  
Followers 0