Board index » delphi » Help with 'Hide cursor'

Help with 'Hide cursor'

Does someone know how to hide the cursor..The blinking slash ??????

Thanks in advance !?!

 

Re:Help with 'Hide cursor'


In article <3162D570.3...@technis.vtyh.fi>,
Joachim Wickman  <jwick...@technis.vtyh.fi> wrote:
:Does someone know how to hide the cursor..The blinking slash ??????

 96535 Mar 30 20:19 ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip
 tsfaqp.zip Common Turbo Pascal Questions and Timo's answers

   All the best, Timo

....................................................................
Prof. Timo Salmi   Co-moderator of news:comp.archives.msdos.announce
Moderating at ftp:// & http://garbo.uwasa.fi archives  193.166.120.5
Department of Accounting and Business Finance  ; University of Vaasa
t...@uwasa.fi http://uwasa.fi/~ts BBS 961-3170972; FIN-65101,  Finland

Re:Help with 'Hide cursor'


Quote
Joachim Wickman wrote:

> Does someone know how to hide the cursor..The blinking slash ??????

> Thanks in advance !?!

Try this

Procedure CursorGone;
Var
  Regs:Registers;
Begin
  Regs.ah:=$01;
  Regs.ch:=$20;
  Regs.cl:=$0E;
  Intr($10,regs);
End;

Procedure CursorBack;
Var
  Regs:Registers;
Begin
  Regs.ah:=$01;
  Regs.ch:=$0D;
  Regs.cl:=$0E;
  Intr($10,regs);
End;

Good Luck
Jerry

Re:Help with 'Hide cursor'


Quote
Joachim Wickman wrote:
> Does someone know how to hide the cursor..The blinking slash ??????

        Here you go...

{--SNIP--}

procedure cursoroff; assembler;

          asm {cursor off}
              mov ah, 01h
              mov ch, 01
              mov cl, 00
              int 10h
          end;

{--SNIP--}

        and if you want to turn it back on...

{--SNIP--}

procedure cursoron; assembler;

          asm {cursor on}
              mov ah, 01h
              mov ch, 06
              mov cl, 07
              int 10h
          end;

{--SNIP--}

        Hope that helps. Ciao!

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
       Paul Matthews - Lead Programmer : Creative Logic Software
        Check out the ALL NEW Creative Logic Software Homepage!
                 http://www.singnet.com.sg/~pmatth/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Re:Help with 'Hide cursor'


Quote
Paul Matthews <pma...@singnet.com.sg> writes:
> Joachim Wickman wrote:
> > Does someone know how to hide the cursor..The blinking slash ??????

>    Here you go...

> {--SNIP--}

> procedure cursoroff; assembler;

>           asm {cursor off}
>               mov ah, 01h
>               mov ch, 01
>               mov cl, 00
>               int 10h
>           end;

> {--SNIP--}

This will work, but there's a better way.

Quote
>    and if you want to turn it back on...

> {--SNIP--}

> procedure cursoron; assembler;

>           asm {cursor on}
>               mov ah, 01h
>               mov ch, 06
>               mov cl, 07
>               int 10h
>           end;

> {--SNIP--}

*This* is not ok!

You've just set the cursor to the default CGA cursor. On anything else,
this gives you a cursor that looks like a hyphen! You have to determine
the screen type. If it is MDA or Hercules, then use 11 and 12 instead
of 6 and 7.

For anything else, you want to use the Int 10h function that *tells*
you what the start and end line of the cursor is, the OR the start line
with 20H (if I recall correctly, check Ralf Brown's Interrupt list for
details). Then to restore the cursor you just read the values again and
And with a mask that'll strip out the bit you set.

The reason for treating the MDa and Herc differently is thaty the "read
cursor start/end line" call returns the wrong values on those cards.

See Timo's FAQ for more details on all of this.

Leonard Erickson (aka Shadow)
 sha...@krypton.rain.com   <--preferred
leon...@qiclab.scn.rain.com        <--last resort

Re:Help with 'Hide cursor'


"G. C. Straty" <str...@bldrdoc.gov> writes:

Quote
> Joachim Wickman wrote:

> > Does someone know how to hide the cursor..The blinking slash ??????

> > Thanks in advance !?!

> Try this

> Procedure CursorGone;
> Var
>   Regs:Registers;
> Begin
>   Regs.ah:=$01;
>   Regs.ch:=$20;
>   Regs.cl:=$0E;
>   Intr($10,regs);
> End;

> Procedure CursorBack;
> Var
>   Regs:Registers;
> Begin
>   Regs.ah:=$01;
>   Regs.ch:=$0D;
>   Regs.cl:=$0E;
>   Intr($10,regs);
> End;

That restored cursor is gonna look *real* strange on a CGA or Hercules
screen.... :-)

Leonard Erickson (aka Shadow)
 sha...@krypton.rain.com   <--preferred
leon...@qiclab.scn.rain.com        <--last resort

Re:Help with 'Hide cursor'


Quote
Leonard Erickson wrote:
> You've just set the cursor to the default CGA cursor. On anything else,
> this gives you a cursor that looks like a hyphen! You have to determine
> the screen type. If it is MDA or Hercules, then use 11 and 12 instead
> of 6 and 7.

> For anything else, you want to use the Int 10h function that *tells*
> you what the start and end line of the cursor is, the OR the start line
> with 20H (if I recall correctly, check Ralf Brown's Interrupt list for
> details). Then to restore the cursor you just read the values again and
> And with a mask that'll strip out the bit you set.

        This is true, but how many people do you see using CGA monitors these days?

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
       Paul Matthews - Lead Programmer : Creative Logic Software
        Check out the ALL NEW Creative Logic Software Homepage!
                 http://www.singnet.com.sg/~pmatth/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Re:Help with 'Hide cursor'


Quote
Paul Matthews <pma...@singnet.com.sg> writes:
> Leonard Erickson wrote:
> > You've just set the cursor to the default CGA cursor. On anything else,
> > this gives you a cursor that looks like a hyphen! You have to determine
> > the screen type. If it is MDA or Hercules, then use 11 and 12 instead
> > of 6 and 7.

> > For anything else, you want to use the Int 10h function that *tells*
> > you what the start and end line of the cursor is, the OR the start line
> > with 20H (if I recall correctly, check Ralf Brown's Interrupt list for
> > details). Then to restore the cursor you just read the values again and
> > And with a mask that'll strip out the bit you set.

>    This is true, but how many people do you see using CGA monitors
> these days?

Re-read what I wrote. The code was setting things to the *CGA* cursor,
which looks damn funny on anything else.

And I do see a fair number of people using CGA and mono monitors. Not
everyone can afford new gear. Some can only afford what other folks
consider junk.

Leonard Erickson (aka Shadow)
 sha...@krypton.rain.com   <--preferred
leon...@qiclab.scn.rain.com        <--last resort

Other Threads