© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
57 replies
Deleted User 3t47rcvavy

uE0B0 working in VSC Terminal but not cmd.exe

using System;
using System.Threading;
using System.Text;
using System.Runtime.InteropServices;

namespace App {
    class Program {
        [DllImport( "kernel32.dll", SetLastError = true )]
        public static extern bool SetConsoleMode( IntPtr hConsoleHandle, int mode );
        [DllImport( "kernel32.dll", SetLastError = true )]
        public static extern bool GetConsoleMode( IntPtr handle, out int mode );

        [DllImport( "kernel32.dll", SetLastError = true )]
        public static extern IntPtr GetStdHandle( int handle );

        static void Main() {
            var handle = GetStdHandle( -11 );
            int mode;
            GetConsoleMode( handle, out mode );
            SetConsoleMode( handle, mode | 0x4 );
           
            Console.OutputEncoding = System.Text.Encoding.Unicode;
            

            int width = Console.WindowWidth;
            Console.WriteLine($"\x1b[48;2;0;206;209m\x1b[38;2;17;17;27m\uE0B0\x1b[38;2;0;150;240m \u2699 \x1b[38;2;255;128;128m\u26CA \x1b[39m axa@axa \x1b[0m\x1b[38;2;0;206;209m\x1b[48;2;255;215;0m\uE0B0 ~ \x1b[0m\x1b[38;2;255;215;0m\uE0B0");
            Console.ResetColor();
        }

    }

}
using System;
using System.Threading;
using System.Text;
using System.Runtime.InteropServices;

namespace App {
    class Program {
        [DllImport( "kernel32.dll", SetLastError = true )]
        public static extern bool SetConsoleMode( IntPtr hConsoleHandle, int mode );
        [DllImport( "kernel32.dll", SetLastError = true )]
        public static extern bool GetConsoleMode( IntPtr handle, out int mode );

        [DllImport( "kernel32.dll", SetLastError = true )]
        public static extern IntPtr GetStdHandle( int handle );

        static void Main() {
            var handle = GetStdHandle( -11 );
            int mode;
            GetConsoleMode( handle, out mode );
            SetConsoleMode( handle, mode | 0x4 );
           
            Console.OutputEncoding = System.Text.Encoding.Unicode;
            

            int width = Console.WindowWidth;
            Console.WriteLine($"\x1b[48;2;0;206;209m\x1b[38;2;17;17;27m\uE0B0\x1b[38;2;0;150;240m \u2699 \x1b[38;2;255;128;128m\u26CA \x1b[39m axa@axa \x1b[0m\x1b[38;2;0;206;209m\x1b[48;2;255;215;0m\uE0B0 ~ \x1b[0m\x1b[38;2;255;215;0m\uE0B0");
            Console.ResetColor();
        }

    }

}


Should look sm like diz
but its
image.png
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

✅ Database cmd.ExecuteScalar() ERROR
C#CC# / help
2y ago
✅ .EXE works in release but not publish?
C#CC# / help
3y ago
"netsh" cmd Commands not being executed
C#CC# / help
3y ago
❔ Launch in integrated terminal, but in VS
C#CC# / help
3y ago