tags:

views:

92

answers:

5

I'm new to Windows development, having messed around in Linux for a while. I need to access console functions and am having trouble getting a comprehensive list of console text attributes off the web. I would like to read wincon.h and windows.h to get the info, but I can't figure out how to get at them. Help please!

A: 

They probably came with your compiler.

Noah Roberts
+1  A: 

You'll have to install the Windows SDK to get the header files. Windows doesn't come with the software development tools out of the box and depending on which compiler you're using, they might not come with the compiler either.

Timo Geusch
+5  A: 

Windows does not come with these by default. If you are looking for them, you need to install the Windows SDK and dig around in the %PROGRAMFILES%\Microsoft SDKs\Windows directory.

Billy ONeal
A: 

I would try looking up the console function listing on MSDN

Jacob
Already did. As I said, it's not comprehensive, and I'd like a full list, including the actual values for the constants defined in the header file: I need the values for some python console programs.
Scribble Master
Had a look at the documentation on the CHAR_INFO structure on MSDN? Containers a listing of the names and values of the character attributes.
Jacob
Thanks, that's helpful, but again, not comprehensiveFOREGROUND_BLACK = 0x0000FOREGROUND_BLUE = 0x0001FOREGROUND_GREEN = 0x0002FOREGROUND_CYAN = 0x0003FOREGROUND_RED = 0x0004FOREGROUND_MAGENTA = 0x0005FOREGROUND_YELLOW = 0x0006FOREGROUND_GREY = 0x0007FOREGROUND_INTENSITY = 0x0008These are some more that I found elsewhere. I am curious as to whether there are any more special values.
Scribble Master
I could write a script to loop through all the possible hex values and check, but that would be very tedious to read.
Scribble Master
Well, just looking at those values, wouldn't it seem logical that the "special" values are simple the RGB combinations of the 3 base colors red, green and blue, and an intensity bit for the most significant bit? If you interpret the description in the CHAR_INFO the right way, that's what "Text color contains 'color'" means? Upvoted the approved answer though, because it's for your actual question.
Jacob
COMMON_LVB_LEADING_BYTE0x0100 Leading byte.COMMON_LVB_TRAILING_BYTE0x0200 Trailing byte.COMMON_LVB_GRID_HORIZONTAL0x0400 Top horizontalCOMMON_LVB_GRID_LVERTICAL0x0800 Left vertical.COMMON_LVB_GRID_RVERTICAL0x1000 Right vertical.COMMON_LVB_REVERSE_VIDEO0x4000 Reverse foreground and background attribute.COMMON_LVB_UNDERSCORE0x8000 Underscore.I mean values like these
Scribble Master
But thank for the info about the colors. I didn't realize that - I'm still and amateur. Now they'll be easier to remember.
Scribble Master
That's a good question, their documentation isn't exactly fulfilling regarding what actions they perform.
Jacob
+1  A: 

They're normally stored along with the other SDK headers. Assuming you're using Visual Studio, the easy to look at them is to create a file, add a line to #include the file you care about, right click it, and click on the open document <whatever.h> line in the pop-up menu.

Jerry Coffin