Mouse cursor flickering

Started by Elias Montoya, October 31, 2014, 10:36:44 PM

Previous topic - Next topic

Elias Montoya


  I was getting a strange flickering in my cursor, so followed the example in here:
http://www.planetsquires.com/protect/forum/index.php?topic=1789.msg14882#msg14882

But the mouse cursor flickers even in an empty newly created dialog. I am
guessing firefly does something under the water?

How can i work around this?

BTW, I am using windows 7.
Win7, iMac x64 Retina display 5K, i7-5820K 4.4 ghz, 32GB RAM, All updates applied. - Firefly 3.70.

Elias Montoya


The cursor doesnt flicker if i use SetCapture in the target dialog...
If there is a better way than this, please do tell. :)
Win7, iMac x64 Retina display 5K, i7-5820K 4.4 ghz, 32GB RAM, All updates applied. - Firefly 3.70.

David Kenny

From Lance Edmonds at PB Forums:
QuoteThe problem is that the class cursor for the control/dialog is restored by Windows. The solution is to either create the control/dialog with a NULL cursor and change it with SetCursor(), or...

Use SetClassLong(...%GCL_HCURSOR...) once and windows will use that cursor until you change it again.

It's a good idea to restore the original cursor when your control/dialog is destroyed, and if necessary release the handle for the cursor. ie, always clean up after yourself.

Here are two posts asking about mouse flicker and his response to both:
http://www.powerbasic.com/support/pbforums/showthread.php?t=1950
http://www.powerbasic.com/support/pbforums/showthread.php?t=4833

It would seem that SetClassLong is what you are looking for, but I haven't tested it.  I would have had you included the problem code.:)