|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 20 Aug 2008 17:50:46 +0200, Invisible <voi### [at] devnull> wrote:
> I've tried things like this several times before, and it's never worked
> for me...
As I said before, only 16-bit applications can use colour escapes under NT.
--
FE
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Invisible" <voi### [at] devnull> wrote in message
news:48ac3d56$1@news.povray.org...
>>>> NT-based console windows do not support colour escape codes. Only
>>>> 16-bit applications (running under NTVDM) can use colour escapes.
>>>
>>> So this doesn't work?
>>>
>>>
http://www.windowsnetworking.com/kbase/WindowsTips/Windows2000/UserTips/Miscellaneous/CommandInterpreterAnsiSupport.html
>>
>> "the command.com shell interpreter"
>>
>> "Any DOS applications you run in this command shell will now have ANSI
>> support."
>
> I've tried things like this several times before, and it's never worked
> for me...
I run ksh on my windows xp machine and I'm able to do all that with just a
few escape sequences in my .profile
Jim
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Invisible wrote:
> I cannot for the life of me figure out how to get at
> symbolic constant names. :-(
Technically, there's no such thing in C as such. The #define substitutes
the actual value for the name before the "compiler proper" ever sees it.
That's why the C standard requires something like
f(3 + 2);
to not do any additions before invoking f(5). Otherwise, people would
hesitate to use something like
#define LAST (PREV+1)
--
Darren New / San Diego, CA, USA (PST)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Fredrik Eriksson wrote:
> On Wed, 20 Aug 2008 17:43:05 +0200, Darren New <dne### [at] sanrrcom> wrote:
>> Fredrik Eriksson wrote:
>>> NT-based console windows do not support colour escape codes. Only
>>> 16-bit applications (running under NTVDM) can use colour escapes.
>>
>> So this doesn't work?
>>
>>
http://www.windowsnetworking.com/kbase/WindowsTips/Windows2000/UserTips/Miscellaneous/CommandInterpreterAnsiSupport.html
>>
>
> "the command.com shell interpreter"
>
> "Any DOS applications you run in this command shell will now have ANSI
> support."
Oh. OK. So you can't invoke it from command.com and have it work?
--
Darren New / San Diego, CA, USA (PST)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 20 Aug 2008 18:08:05 +0200, Darren New <dne### [at] sanrrcom> wrote:
> Oh. OK. So you can't invoke it from command.com and have it work?
Only if it is a 16-bit application. The colour escape functionality is
provided by 'ansi.sys' which is a 16-bit driver.
--
FE
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Invisible wrote:
> I wonder... Is there some function call in the Win32 API that can
> actually change the colour of the text in a console window? Or is that
> impossible? Does anybody here know the Win32 API well enough to know the
> answer?
Yes, there is:
#include "stdio.h"
#include "windows.h"
void main()
{
HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hCon, 0x0C);
printf("Hello in red");
SetConsoleTextAttribute(hCon, 0x09);
printf(" and in blue\n");
getchar();
}
Detailed here:
http://msdn.microsoft.com/en-us/library/ms686047.aspx
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Invisible <voi### [at] devnull> wrote:
> You *know* something's wrong when you find yourself envying people who
> use Unix because it can emulate an obsolete VT100... o_O
> Basically, I have a perfectly working console application, but I wish I
> could just make certain parts of its output come out in a different
> colour. On Unix, this would be a fairly trivial matter of writing some
> escape codes to stdout and you're done.
AFAIK, the VT100 didn't support colors. That came with later versions
of VT.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 20 Aug 2008 16:42:13 +0100, Invisible wrote:
> I meant how to get that stuff into Haskell.
Oh, I see....
Jim
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mike Raiford wrote:
> Yes, there is:
>
> #include "stdio.h"
> #include "windows.h"
>
> void main()
> {
> HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
> SetConsoleTextAttribute(hCon, 0x0C);
> printf("Hello in red");
> SetConsoleTextAttribute(hCon, 0x09);
> printf(" and in blue\n");
> getchar();
> }
>
> Detailed here:
> http://msdn.microsoft.com/en-us/library/ms686047.aspx
Yah, that works.
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp wrote:
> AFAIK, the VT100 didn't support colors. That came with later versions
> of VT.
Rather alarmingly, you're right again...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |