How do you hide the cursor in C using dos
How do you hide the cursor in C using dos
One method is to make a few inline ASM calls. You'll just have to port these to the appropriate compiler:
Deactivate cursor:
mov cx,1900h
xor bh,bh
mov ah,1
int 10h
Activate cursor:
mov cx,607h
xor bh,bh
mov ah,1
int 10h
There are probably other methods, but this is the one that i'm familiar with. the common directive is _asm ... . just consult the FAQ section.
Peter Kimberley
[email protected]
Through direct VGA-port programming (not using BIOS)
---------------
// hiding cursor
push ax
push dx
mov dx,03d4h ;/*CRTC*/
mov al,0ah ;/*cursor-start VGA reg*/
out dx,al
inc dx
in al,dx
or al,0010000b ;/*cursor off*/
out dx,al
pop dx
pop ax
--------------
// show it again
push ax
push dx
mov dx,003d4h ;/*CRTC*/
mov al,0ah ;/*cursor-start VGA reg*/
out dx,al
inc dx
in al,dx
and al,11011111b ;/*cursor on*/
out dx,al
pop dx
pop ax
Assembly rules!!!!
Have fun & enjoy!
[R]evolution!
Programming related articles, downloads, demos