Need function to set mouse pointer that WORKS.

BlitzPlus Forums/BlitzPlus Programming/Need function to set mouse pointer that WORKS.

sswift(Posted 2005) [#1]
http://www.blitzbasic.com/codearcs/codearcs.php?code=1289

That is the current mouse pointer function I am using...

It will set the mouse pointer under most circumstances, but I'm having one problem with it.

For some reason when I recalculate my textures, the pointer, which I have changed to an hourglass, turns back into an arrow in the middle of the operation.

I have checked and rechecked my code, and nowhere do I call setpointer, showpointer, or hidepointer in the middle of this operation.

I call showpointer and hidepointer nowhere in my code, and the only place I call setpointer is in my main input loop, which is not run while this function is executing, and at the start and end of this function.

Something in the function... creating new chances, showing/hiding canvases, showing hiding sliders... is causing the pointer to revert.

And the weird thing is that calling setpointer multiple times in the funtion to try to reset it back to an hourglass has absolutely no effect. It still changes back to an arrow at the same time every time.

Now, the windows docs say setpointer will not set the pointer if you're setting the same pointer as the last call. Fair enough... So I set the pointer to no pointer, and then set it to the hourglass.

Still no change. Pointer still stays an hourglass for about half a second and then reverts to an arrow.

Function also says that pointer will revert is the window class default pointer is not set to null and the mouse is moved. I really didn't want to screw with window classes, so I was careful to make sure I didn't move my mouse after I began the operation. Pointer still changed back to an arrow.

I know other folks have posted pointer code to the code archives, so some other folks out there must be changing the pointer in their apps. Has anyone run into this?


BlitzSupport(Posted 2005) [#2]
You have to set the window's 'class cursor' to Null, or else Windows resets it constantly.

Try SetClassLong with the cursor value (GCL_HCURSOR = -12) set to Null and see if that does it...


sswift(Posted 2005) [#3]
Thanks a bunch, that worked like a charm. I'll update the code archives entry to include this. :-)