color output

Discussion in 'C Programming' started by Carramba, Feb 7, 2005.

  1. Carramba

    Carramba Guest

    Hi again :)

    is it posible to get color output in dos aplication with C?
    if yes how?!

    thanx in advance!

    --
    ______________________________________
    I se the lightat the end, but every time I take a step it's get dim.
     
    Carramba, Feb 7, 2005
    #1
    1. Advertising

  2. Carramba <> scribbled the following:
    > Hi again :)


    > is it posible to get color output in dos aplication with C?
    > if yes how?!


    > thanx in advance!


    That depends on your console settings, and is not defined by C. Please
    ask in a DOS newsgroup.

    --
    /-- Joona Palaste () ------------- Finland --------\
    \-------------------------------------------------------- rules! --------/
    "You can pick your friends, you can pick your nose, but you can't pick your
    relatives."
    - MAD Magazine
     
    Joona I Palaste, Feb 7, 2005
    #2
    1. Advertising

  3. Carramba

    Carramba Guest

    On 7 Feb 2005 17:28:07 GMT, Joona I Palaste <> wrote:

    > Carramba <> scribbled the following:
    >> Hi again :)

    >
    >> is it posible to get color output in dos aplication with C?
    >> if yes how?!

    >
    >> thanx in advance!

    >
    > That depends on your console settings, and is not defined by C. Please
    > ask in a DOS newsgroup.
    >

    what does it have to do with console setings? you can overwrite it! it's
    in WinApi.h .... so I gues it's defined by C...


    --
    Thanx in advance!

    ;-)

    ______________________________________
    I se the lightat the end, but every time I take a step it's get dim.
     
    Carramba, Feb 7, 2005
    #3
  4. Carramba <> scribbled the following:
    > On 7 Feb 2005 17:28:07 GMT, Joona I Palaste <> wrote:
    >> Carramba <> scribbled the following:
    >>> Hi again :)

    >>
    >>> is it posible to get color output in dos aplication with C?
    >>> if yes how?!

    >>
    >>> thanx in advance!

    >>
    >> That depends on your console settings, and is not defined by C. Please
    >> ask in a DOS newsgroup.
    >>

    > what does it have to do with console setings? you can overwrite it! it's
    > in WinApi.h .... so I gues it's defined by C...


    WinApi.h is part of your operating system, not part of the C
    programming language. All the world is not MS Windows, you know. Please
    find a Windows or MS-DOS newsgroup.

    --
    /-- Joona Palaste () ------------- Finland --------\
    \-------------------------------------------------------- rules! --------/
    "Holy Banana of this, Sacred Coconut of that, Magic Axolotl of the other."
    - Guardian in "Jinxter"
     
    Joona I Palaste, Feb 7, 2005
    #4
  5. Carramba

    Lew Pitcher Guest

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Carramba wrote:
    > On 7 Feb 2005 17:28:07 GMT, Joona I Palaste <> wrote:
    >
    >> Carramba <> scribbled the following:
    >>
    >>> Hi again :)

    >>
    >>
    >>> is it posible to get color output in dos aplication with C?
    >>> if yes how?!

    >>
    >>
    >>> thanx in advance!

    >>
    >>
    >> That depends on your console settings, and is not defined by C. Please
    >> ask in a DOS newsgroup.
    >>

    > what does it have to do with console setings? you can overwrite it!
    > it's in WinApi.h .... so I gues it's defined by C...


    No, it's not "defined by C". WinApi.h is not part of the standard C language,
    and is not discussed here.

    OTHO, WinApi.h is defined by Microsoft, for use by their extensions to standard
    C, on the Microsoft Windows operating system. So, if you want to discuss
    WinApi.h, your best bet is to join one of the comp.os.ms-windows newsgroups and
    discuss it there.





    - --
    Lew Pitcher
    IT Specialist, Enterprise Data Systems,
    Enterprise Technology Solutions, TD Bank Financial Group

    (Opinions expressed are my own, not my employers')
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.4 (MingW32)

    iD8DBQFCB7HlagVFX4UWr64RAtApAKCu8R8l9LHiehS9J1zCqnPetzcoFQCeIake
    Idfw3rYvrAUew/ct9A5PaO0=
    =+SRW
    -----END PGP SIGNATURE-----
     
    Lew Pitcher, Feb 7, 2005
    #5
  6. Carramba

    Mabden Guest

    "Carramba" <> wrote in message
    news:eek:pslt7voir5plaj0@big...
    > Hi again :)
    >
    > is it posible to get color output in dos aplication with C?
    > if yes how?!
    >


    If you can guarantee that ANSI.SYS is loaded, you could output ANSI
    codes in the text. These are strings that begin with an ESC character
    (ANSI code decimal 27), then a square bracket, followed by a code
    sequence.

    This example may work for you if it gets through unchanged (put it in a
    batch file to see it work). I can't test it as my Win2K system runs
    CMD.EXE not DOS. It is part of a color selection batch file I used to
    use.

    =============================
    @echo off
    REM Note: ANSI.SYS device driver must be loaded in C:\CONFIG.SYS
    REM Choose foreground colors.
    echo  B. Black  K. blacK
    %color%
    echo  R. Red  D. reD
    %color%
    echo  G. Green  N. greeN
    %color%
    echo  O. Orange  Y. Yellow
    %color%
    echo  L. bLue  E. bluE
    %color%
    echo  M. Magenta  T. magenTa
    %color%
    echo  C. Cyan  A. cyAn
    %color%
    echo  W. White  H. wHite
    %color%

    =============================

    But the real question is, "Why am I coding C in DOS?"

    --
    Mabden
     
    Mabden, Feb 8, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. moondaddy
    Replies:
    3
    Views:
    38,339
    moondaddy
    Apr 28, 2004
  2. PJ6
    Replies:
    4
    Views:
    4,897
  3. Andrew Arace

    BGR Color to Java Color

    Andrew Arace, Sep 13, 2003, in forum: Java
    Replies:
    7
    Views:
    7,807
    Stephen Gilbert
    Sep 16, 2003
  4. Niels Dybdahl

    Color.white vs. Color.WHITE

    Niels Dybdahl, Oct 6, 2004, in forum: Java
    Replies:
    3
    Views:
    446
    Chris Smith
    Oct 6, 2004
  5. Kamaljeet Saini
    Replies:
    0
    Views:
    430
    Kamaljeet Saini
    Feb 13, 2009
Loading...

Share This Page