mirror of
https://github.com/a0rtega/pafish
synced 2024-11-22 06:11:18 +03:00
Merge branch 'born2c0de-master' into dev-chaos
This commit is contained in:
commit
638a7cd84e
@ -6,9 +6,20 @@
|
||||
|
||||
#include "common.h"
|
||||
|
||||
void init_cmd_colors() {
|
||||
unsigned short init_cmd_colors() {
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
HANDLE handler = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
// Get original console colors
|
||||
GetConsoleScreenBufferInfo(handler, &csbi);
|
||||
SetConsoleTextAttribute(handler, FOREGROUND_INTENSITY);
|
||||
// Return original console colors
|
||||
return csbi.wAttributes;
|
||||
}
|
||||
|
||||
void restore_cmd_colors(unsigned short original_colors) {
|
||||
HANDLE handler = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
// Restore original console colors
|
||||
SetConsoleTextAttribute(handler, original_colors);
|
||||
}
|
||||
|
||||
void print_header() {
|
||||
|
@ -2,7 +2,9 @@
|
||||
#ifndef COMM_H
|
||||
#define COMM_H
|
||||
|
||||
void init_cmd_colors();
|
||||
unsigned short init_cmd_colors();
|
||||
|
||||
void restore_cmd_colors(unsigned short);
|
||||
|
||||
void print_header();
|
||||
|
||||
|
@ -36,10 +36,11 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
char icon[] = "Blue fish icon thanks to http://www.fasticon.com/", winverstr[32], aux[1024];
|
||||
OSVERSIONINFO winver;
|
||||
unsigned short original_colors = 0;
|
||||
|
||||
write_log("Start");
|
||||
|
||||
init_cmd_colors();
|
||||
original_colors = init_cmd_colors();
|
||||
print_header();
|
||||
|
||||
winver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
@ -335,6 +336,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
/* Restore Original Console Colors */
|
||||
restore_cmd_colors(original_colors);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user