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!
+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
2010-06-25 17:06:01
+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
2010-06-25 17:06:03
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
2010-06-25 17:10:58
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
2010-06-25 17:15:18
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
2010-06-25 17:18:49
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
2010-06-25 17:19:52
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
2010-06-25 17:24:39
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
2010-06-25 17:26:37
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
2010-06-25 17:29:32
That's a good question, their documentation isn't exactly fulfilling regarding what actions they perform.
Jacob
2010-06-25 17:30:10
+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
2010-06-25 17:07:10