I am using getkey in a console program & don't want a cursor flashing on screen. In my DOS days you just moved it out of sight onto another page. How do you do it in Win32?
Neil,
invoke ShowCursor,TRUE ; show the cursor
invoke ShowCursor,FALSE ; hide cursor
Make sure you do this correctly both ways or you can lose the cursor.
Thanks Hutch, just what I wanted :U
It's probably not what you wanted :P
ShowCursor shows/hides the mouse pointer, not the console cursor.
Try SetConsoleCursorPosition -- http://msdn.microsoft.com/en-us/library/ms686025.aspx
Tedd you're right, I still haven't found a way of doing it :(
I'll have a look at that link you posted, thanks
I've checked the link out Tedd & that's the APi the loc macro calls. I'm wondering now if it's just as simple as hiding the cursor off the bottom of the display, I'll give it a try.
No, that's not it, the display just scrolls down to where the cursor is HMMM!
Have you tried a negative position? (Try x first, then y if that doesn't work.)
Failing that, how about moving it to the bottom-right corner, and setting it to black text on black background?
Just had a half hour power cut here.
I tried both of those methods Tedd & neither worked.
I've had another idea, there is a way of setting the size (vertically) of the cursor, I wonder if it's possible to reduce it to zero, I'll read up on it.
try this:.data?
cci CONSOLE_CURSOR_INFO <>
chand dd ?
.code
invoke GetStdHandle,STD_OUTPUT_HANDLE
mov chand,eax
invoke GetConsoleCursorInfo,chand,addr cci
inkey "Press any key to hide cursor"
mov cci.bVisible,FALSE
invoke SetConsoleCursorInfo,chand,addr cci
inkey "Press any key to restore cursor"
mov cci.bVisible,TRUE
invoke SetConsoleCursorInfo,chand,addr cci
inkey "Press any key to exit..."
ret
Just had another power cut!
Thanks Jimg, that code works perfectly :U
All I have to do now is adapt it into my code