News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

ShowCursor has changed ?

Started by donkey, January 19, 2012, 07:44:38 PM

Previous topic - Next topic

donkey

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.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

MichaelW

The Microsoft mouse driver functions to show and hide the cursor worked like this as far back as I can remember.
eschew obfuscation

donkey

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.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

dedndave

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