Change command prompt properties in c

2

I'm new to c. I would like to know if it is possible to change properties of the command prompt by c, such as cmd size, width or even the font?

    
asked by anonymous 22.06.2017 / 02:15

2 answers

1

From what I understand, you will have to change these properties in the Windows registry. For each property there is a DWORD value. Very careful when changing these values, some invalid data may end up corrupting and compromising the operating system. Before changing you will have to do a data conversion to hexadecimal. The registry key responsible for these properties is: HKEY_CURRENT_USER \ Console .

If you still have no idea how to do this in C language, follow a link to a tutorial that can help you:

Add / Delete and Read Windows Registry in C #, simple and straightforward.

    
24.06.2017 / 02:11
0

You can use color codes:

#include <stdio.h>

#define RED   "\x1B[31m"
#define GRN   "\x1B[32m"
#define YEL   "\x1B[33m"
#define BLU   "\x1B[34m"
#define MAG   "\x1B[35m"
#define CYN   "\x1B[36m"
#define WHT   "\x1B[37m"
#define RESET "\x1B[0m"

int main()
{
  printf(RED "vermelho\n" RESET);
  printf(GRN "verde\n" RESET);
  printf(YEL "amarelo\n" RESET);
  printf(BLU "azul\n" RESET);
  printf(MAG "magenta\n" RESET);
  printf(CYN "ciano\n" RESET);
  printf(WHT "branco\n" RESET);

  return 0;
}
    
22.06.2017 / 13:10