Link to home
Start Free TrialLog in
Avatar of AndersCarlsson
AndersCarlsson

asked on

Blinking cursor ...

I have a graphic application, with moving objects on a surface. I uppdate the objects with the BitBlt function.
But my cursor blinks when i put it over the objects. How can i avoid this ?
Avatar of AlexVirochovsky
AlexVirochovsky

I think, you can't(windows display you Image, after that
restore cursor). Other way(wuth same result!):
Hide Cursor, BitBlt, Restore Cursor.
Avatar of AndersCarlsson

ASKER

Yes Alex!
Same result. ShowCursor(FALSE), BitBlt ShowCursor(TRUE) gives blinking also.
Any other suggestions ?
Avatar of Zoppo
I think a non-blinking cursor above changing backgrounds is only possible with default cursors, which are usually handled by the graphics card.
Am I right ???
ZOPPO
New idea! Read Bar with cursor(from Screen), place to you Image,
BitBlt! Size of Bar depends from size of Cursor, of course!
ZOPPO!
No , the system cursor also blinks!

Alex!
Read Bar ..?
What is that?
Help me with some code please.

/Anders
dc = GetDC(NULL); Get Dc of Screen
mdc = CreateCompatibleDC(dc); //create comp(or use dc of you
Bitmap)
BitBlt(mdc,x, y, x+nWidth, y + nHeight,dc,0,0,SRCCOPY);
//where x, y, ..: coordinates of you Blinking Cursor
ReleaseDC(NULL, dc); //rekease dc of Screen

ASKER CERTIFIED SOLUTION
Avatar of nietod
nietod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
NIETOD:
We have a similar problem. The cursor flickers not only when it is over the updated area but also when it is below and to the right of that area. We only update the changed portion of the screen.
We noticed also that the cursor flickers only on certain graphic card chipsets (ex S3 Virge, ATI Rage Pro and i740) but not on nVidia Riva128 or TNT.
And even one graphic card MGA Matrox Millenium in a dual boot system it flickers in Win95 but not in Win NT 4.0.
Often The cursor will often flicker when it is near the update region, even if is not directly over it. I suspect that this is because if any portion of the cursor rectangle (even if it is not actually used as part of the cursor) overlaps the update region, the cursor is hidden before the update begins and then is restored after the update ends.  

In windows 3.1 (in my experice with it anyways) the cursor used to be hidden whenever there was an update even if it was not near it, so it used to flash like crazy.  That seems to have dissapeared in 95, for me anyways.

Some platforms like Mac and Sparc maintain the cursor in hardware, this allows the program to paint to the screen at the cursor location without it affecting the cursor.  When the cursor is moved the proper painted information is displayed.  I don't know if that is ever done in the windows world, but if so it might explain why some hardware does not flicker and some does.