flat assembler
Message board for the users of flat assembler.

Index > Windows > SetConsoleCursorInfo

Author
Thread Post new topic Reply to topic
Picnic



Joined: 05 May 2007
Posts: 1389
Location: Piraeus, Greece
Picnic 09 Feb 2008, 10:33
Hello all,
I'm experimenting on Windows console functions but i'm having some trouble with SetConsoleCursorInfo
I want to completely fill console cursor, and make it box shape.
Can someone give me a simple example ?
Post 09 Feb 2008, 10:33
View user's profile Send private message Visit poster's website Reply with quote
asmhack



Joined: 01 Feb 2008
Posts: 431
asmhack 09 Feb 2008, 13:08
never used this before but tried now...
here is the code thimis:

Code:
format pe console on 'nul'
entry @@entry

include 'win32a.inc'

section '' import data code writable readable executable
library kernel32,'kernel32'
include 'api\kernel32.inc'

stdout dd $0
stdin  dd $0

tmp    dd $0
msg    rb $FF

struc ccnfo
{
  .dwSize   dd $0                 
;   /* Between 1-100 for percentage of cell filled "dword" */
  .bVisible db $0                 
;   /* Visibility of cursor "bool" */
} LPCONSOLE_CURSOR_INFO ccnfo

@@entry:
xor ebx,ebx

stdcall [GetStdHandle],-11
mov [stdout],eax
stdcall [GetStdHandle],-10
mov [stdin],eax
stdcall [SetConsoleActiveScreenBuffer],eax

mov [LPCONSOLE_CURSOR_INFO.dwSize],50
mov [LPCONSOLE_CURSOR_INFO.bVisible],1

stdcall [SetConsoleCursorInfo],[stdout],LPCONSOLE_CURSOR_INFO

stdcall [ReadConsole],[stdin],msg,$FF-$1,tmp,ebx

stdcall [ExitProcess],ebx
    
Post 09 Feb 2008, 13:08
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1389
Location: Piraeus, Greece
Picnic 09 Feb 2008, 14:41
Thanks a lot asmhack, i appreciate that.
Post 09 Feb 2008, 14:41
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.