Search notes:

WinAPI - cmd.exe

WriteConsole

WriteConsole writes text to the console.
#include <windows.h>

char helloWorld[] = "hello World.\n";

int main() {

    DWORD charsWritten;

    HANDLE stdOut = GetStdHandle(STD_OUTPUT_HANDLE);
    WriteConsole(stdOut, helloWorld, sizeof(helloWorld), &charsWritten, NULL);

}
Github repository about-cmd.exe, path: /WinAPI/WriteConsole.c

SetConsoleTextAttribute

SetConsoleTextAttribute can be used to change the color of the text written.
#include <windows.h>

int main() {

    DWORD charsWritten;
    HANDLE stdOut = GetStdHandle(STD_OUTPUT_HANDLE);

 // Store current color
    CONSOLE_SCREEN_BUFFER_INFO info;
    GetConsoleScreenBufferInfo(stdOut, &info);
    DWORD currentColor = info.wAttributes;

    SetConsoleTextAttribute(stdOut,
    //  FOREGROUND_RED  | FOREGROUND_GREEN | FOREGROUND_BLUE  | BACKGROUND_INTENSITY
        FOREGROUND_RED  |                                       FOREGROUND_INTENSITY |
    //  BACKGROUND_RED  | BACKGROUND_GREEN | BACKGROUND_BLUE  | BACKGROUND_INTENSITY
        BACKGROUND_RED  | BACKGROUND_GREEN |                    BACKGROUND_INTENSITY
    );

    char txt[] = "Red on yellow";
    WriteConsole(stdOut, txt, sizeof(txt), &charsWritten, NULL);

 // Restore color
    SetConsoleTextAttribute(stdOut, currentColor);

}
Github repository about-cmd.exe, path: /WinAPI/SetConsoleTextAttribute.c

See also

cmd.exe

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1745992730, '18.119.136.220', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/dirs/Windows/System32/cmd_exe/WinAPI/index(90): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78