PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Elias Montoya on October 31, 2014, 10:36:44 PM

Title: Mouse cursor flickering
Post by: Elias Montoya on October 31, 2014, 10:36:44 PM

  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.
Title: Re: Mouse cursor flickering
Post by: Elias Montoya on October 31, 2014, 10:43:01 PM

The cursor doesnt flicker if i use SetCapture in the target dialog...
If there is a better way than this, please do tell. :)
Title: Re: Mouse cursor flickering
Post by: David Kenny on November 01, 2014, 04:39:08 AM
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=1950)
http://www.powerbasic.com/support/pbforums/showthread.php?t=4833 (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.:)