![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Wed, 20 Aug 2008 17:43:05 +0200, Darren New <dne### [at] san rr com> 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."
--
FE
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>>> 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...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Fredrik Eriksson wrote:
> On Wed, 20 Aug 2008 17:20:17 +0200, Invisible <voi### [at] dev null> wrote:
>> The hard part, of course, is writing some Haskell bindings. ;-) In
>> particular, I cannot for the life of me figure out how to get at
>> symbolic constant names. :-(
>
> If you are looking for 'FOREGROUND_BLUE' and the like, they are defined
> in 'WinCon.h'. There you will also find the structure definitions
> relevant to the console subsystem.
Yes. I eventually tracked those down.
Also, apparently STD_OUTPUT_HANDLE is -10, not 10. >_<
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Wed, 20 Aug 2008 17:50:46 +0200, Invisible <voi### [at] dev null> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Invisible" <voi### [at] dev null> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Fredrik Eriksson wrote:
> On Wed, 20 Aug 2008 17:43:05 +0200, Darren New <dne### [at] san rr com> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Wed, 20 Aug 2008 18:08:05 +0200, Darren New <dne### [at] san rr com> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Invisible <voi### [at] dev null> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |