1

I'm new to C and making a console application where I need to change the default 16-color palette of the Windows console. I found out through this question that I need to use the SetConsoleScreenBufferInfoEx() function, however, my compiler insists that no such function is declared (I've only included windows.h).

Also, it doesn't recongnise the CONSOLE_SCREEN_BUFFER_INFOEX structure that is needed for the function to work and only recognises CONSOLE_SCREEN_BUFFER_INFO.

I've been searching for a solution for this for days and the closest thing I found was an answer here saying that I need to specify in my code that I'm targeting versions of Windows that are Vista or later. So I've tried defining #define NTDDI_VERSION NTDDI_VISTA and #define _WIN32_WINNT _WIN32_WINNT_VISTA, but that didn't work either.

Remember that I'm new to C, so please try to make any answers and explanations as simple as possible (I'm using Code::Blocks and Windows 10).

EDIT: I did a lot of searching around and here's what I found to help save some time for anyone that might have the same problem (a lot of the information below could be wrong so be warned and feel free to correct it if that's indeed the case):

Community
  • 1
  • 1
tsakman
  • 30
  • 4
  • See the answer to this question for how to include windows.h correctly. The answer might be slightly out of date so you have to look for the correct menu. https://stackoverflow.com/questions/26338747/codeblocks-c-c-windows-h-missing-fatal-error – wooooooooosh Mar 10 '19 at 23:35

0 Answers0