Re: console display commands

new topic     » goto parent     » topic index » view thread      » older message » newer message

This makes the console cursor not visible:

include std/console.e 
include std/get.e 
include std/dll.e 
include std/machine.e 
 
/* 

BOOL WINAPI SetConsoleCursorInfo( 
  _In_  HANDLE hConsoleOutput, 
  _In_  const CONSOLE_CURSOR_INFO *lpConsoleCursorInfo) 
   
HANDLE WINAPI GetStdHandle( 
  _In_  DWORD nStdHandle) 
   
typedef struct _CONSOLE_CURSOR_INFO { 
  DWORD dwSize; 
  BOOL  bVisible; 
} CONSOLE_CURSOR_INFO, *PCONSOLE_CURSOR_INFO 
 
*/ 
 
puts(1,"Console Cursor Not Visible\n") 
 
integer STD_OUTPUT_HANDLE = -11 
 
atom kernel32 = open_dll("kernel32.dll") 
integer SetConsoleCursorInfo = define_c_func(kernel32,"SetConsoleCursorInfo",{C_INT,C_POINTER},C_INT) 
integer GetStdHandle = define_c_func(kernel32,"GetStdHandle",{C_INT},C_INT) 
 
atom CONSOLE_CURSOR_INFO = allocate(5) 
 
integer ConsoleHandle = c_func(GetStdHandle,{STD_OUTPUT_HANDLE}) 
 
poke4(CONSOLE_CURSOR_INFO,100) 
poke(CONSOLE_CURSOR_INFO+4,0) 
 
if not c_func(SetConsoleCursorInfo,{ConsoleHandle,CONSOLE_CURSOR_INFO}) then 
	puts(1,"Couldn't set cursor info\n") 
end if 
 
if getc(0) then end if 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu