The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: donkey on January 19, 2012, 07:44:38 PM

Title: ShowCursor has changed ?
Post by: donkey on January 19, 2012, 07:44:38 PM
When did Windows begin keeping a display counter on the cursor, I don't seem to remember ever having to deal with it until today using Windows 7. To get the cursor to disappear I needed to write a loop checking the return value until it reached -1:

:
invoke ShowCursor,FALSE
test eax,eax
jns <


Could be that this has been around for a long time but for the life of me I can't ever remember having to do it.

Quote from: MSDNThis function sets an internal display counter that determines whether the cursor should be displayed. The cursor is displayed only if the display count is greater than or equal to 0. If a mouse is installed, the initial display count is 0. If no mouse is installed, the display count is –1.
Title: Re: ShowCursor has changed ?
Post by: MichaelW on January 19, 2012, 08:14:54 PM
The Microsoft mouse driver functions to show and hide the cursor worked like this as far back as I can remember.
Title: Re: ShowCursor has changed ?
Post by: donkey on January 20, 2012, 03:08:58 AM
Quote from: MichaelW on January 19, 2012, 08:14:54 PM
The Microsoft mouse driver functions to show and hide the cursor worked like this as far back as I can remember.

Shows how often I have to hide the cursor, I looked through some very old code I wrote and low and behold I did it that way then as well. Just seemed like I had never run into it before, could be old age creeping up on me.
Title: Re: ShowCursor has changed ?
Post by: dedndave on January 20, 2012, 11:44:21 AM
the CRTC on MDA and CGA adapters had 2 registers for the cursor
one to control the start line and one to control the stop line
the PC BIOS supports some code for it
i believe EGA and VGA adapters used the same stuff and added a cursor disable register
if stop is less than start, no cursor is drawn
the register values are 0-based and 0 is the top of the character cell