Re: Hide Cursor in Console Window
- Posted by euphoric (admin) Jul 09, 2009
- 1170 views
jacques_desch said...
the following code works for me...
It works for me as well. However, removing the extraneous puts() and whiles and wait_keys() causes it not to work.
For instance, this works (code goes right after and replaces all subsequent code after the procedure definition in your code):
puts(1,"a") -- a write to the screen is apparently required in order to set the cursor mode ShowConsoleCursor(GetStdHandle(STD_OUTPUT_HANDLE),0) while get_key()=-1 do end while
But without the prior puts(), it does not work on subsequent writes to the screen. For example, this shows the cursor:
-- no write to the screen prior to the following call means ShowConsoleCursor(GetStdHandle(STD_OUTPUT_HANDLE),0) puts(1,"a") -- the cursor continues to flash hereafter while get_key()=-1 do end while