SetCursor_()

Windows specific forum
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

SetCursor_()

Post by IdeasVacuum »

I set custom cursors for my app window, depending on the whereabouts of cursor in the client area. It works perfectly but if the mouse is moved rapidly, you can see a flicker of the regular cursor on top of the custom cursor. This requires a bit of effort to actually get it to occur on XP and Win7 but is much more noticeable on Win8.

From MSDN http://msdn.microsoft.com/en-us/library ... 85%29.aspx
If your application must set the cursor while it is in a window, make sure the class cursor for the specified window's class is set to NULL. If the class cursor is not NULL, the system restores the class cursor each time the mouse is moved.
That sounds very much like the underlying cause. How do you set the class cursor to null?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: SetCursor_()

Post by ts-soft »

Code: Select all

#GCLP_HCURSOR = -12

SetClassLongPtr_(hWnd, #GCLP_HCURSOR, 0)
MSDN - SetClassLongPtr()
Not tested!
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: SetCursor_()

Post by IdeasVacuum »

Thanks ts-soft, that works perfectly :mrgreen:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply