console

C++ Windows Console Color Palette

霸气de小男生 提交于 2020-01-02 10:29:21
问题 I am making a console application similar to a rudimentary AAlib for a class. I am working with the win32 console. I wish to have more colors to work with. In the properties menu for the console there is a palette, giving 24 bit colors to foreground and background. Is there any way to access this palette in code? The only thing I can think of is redefining the color palette[n] in HKEY_CURRENT_USER\Console for each call to color a character. Alternatively if anyone knows a method for printing

Java - Mac/Windows with System.out.println()

Deadly 提交于 2020-01-02 08:25:45
问题 We all mostly use System.out.println in the Console of our IDE. I am using Eclipse. I can also clearly see the println() message on my Mac's Console app. Which is nice for my personal things. And here is the code: public class Main { public static void main(String[] args) { System.out.println("Is this logged anywhere?"); } } And here's what I see on my Mac: Does Windows have something similar to the Mac's version of Console? 回答1: Sadly, as previously said, we don't really have that on Windows

Parse output from a process that updates a single console line

本小妞迷上赌 提交于 2020-01-02 06:17:21
问题 Greetings stackoverflow members, in a BackgroundWorker of a WPF Frontend i run sox (open source console sound processing tool) in a System.Diagnostics.Process . In that same way i use several other command line tools and parse their output to poulate progress bars in my frontend. This works fine for the other tools but not for Sox since instead of spamming new lines for each progress step, it updates a single line on the console by only using carriage returns (\r) and no line feeds (\n). I

Attaching the console with the GUI in wxWidgets

匆匆过客 提交于 2020-01-02 05:47:05
问题 I'm writing a wxWidgets GUI application, but it also uses some console objects. I need a way of displaying stdout and accessing stdin; the best way to do this, would be displaying the console as well as the GUI. This can be done if a user runs the program from the command prompt/shell etc, but the command prompt does not automatically open to view stdout when the application is ran. I know this has to be possible, because when you run a console application, the console runs automatically. I

Execute and Capture one program from another

一笑奈何 提交于 2020-01-02 05:00:22
问题 In win32 programming in C: Whats the best way to execute a win32 console program within another win32 program, and have the program that started the execution capture the output? At the moment I made the program redirect output to a file, but I am sure I must be able to open some sort of pipe? 回答1: Use the CreateProcess Win32 API to start the child process. Pass to it a STARTUPINFO structure with hStdInput , hStdOutput and hStdError handles set to file handles you opened (either real files or

console2 colors solarized

强颜欢笑 提交于 2020-01-02 02:03:31
问题 I am trying to use Solarized colors on a Windows 7 pc using Console2. I can't get the colors to work correctly though. I tried changing the entries in console.xml as suggested here. Is this all I need to do? Any help would be greatly appreciated. 回答1: Copied from the instructions here: Replace the <colors> ... </colors> section with the following: <colors> <color id="0" r="7" g="54" b="66"/> <!-- black --> <color id="1" r="38" g="139" b="210"/> <!-- blue --> <color id="2" r="133" g="153" b="0

Console chart drawing

会有一股神秘感。 提交于 2020-01-02 01:47:22
问题 I need a way to draw a Dictionary<int,int> into a console application like Dictionary<int, int> chartList = new Dictionary<int, int>() { {50,31}, // x = 50, y = 31 {71,87}, {25,66}, {94,15}, {33,94} }; DrawChart(chartList); should result in something like I've come this far but i'm stuck at the IsHit method, which determines if at the current coordinates should be set a point or not. Could anyone help me at this point? It returns always true. public static void DrawChart(Dictionary<int, int>

How to hide console window in Mac OS (gcc compiler)?

不打扰是莪最后的温柔 提交于 2020-01-01 19:54:29
问题 I write an application with Code::Blocks IDE in Mac OS (C++ application). CodeBlocks uses gcc to compile the source code. When I double click on the output of the project (executable binary file), my application executes correctly but a console application shown. My application is a background application without any reading or writing to console, and I add it to startup items. I don't want when I logon, a balnk console (of my application) shown. I want to hide the console window. How to hide

Why is console animation so slow on Windows? (And is there a way to improve speed?)

三世轮回 提交于 2020-01-01 18:18:23
问题 Well I was bored so wanted to make an animation in a console window. Now when I setup the first bits I noticed it is very slow, something around 333ms for a whole screen to fill with characters.. I am wondering if there is a way to at least get ~20 fps? Here is my code: #include <stdio.h> #include <tchar.h> #include <Windows.h> #include <iostream> #include <array> #define WIDTH (100) #define HEIGHT (35) bool SetWindow(int Width, int Height) { _COORD coord; coord.X = Width; coord.Y = Height;

Why is console animation so slow on Windows? (And is there a way to improve speed?)

天涯浪子 提交于 2020-01-01 18:18:09
问题 Well I was bored so wanted to make an animation in a console window. Now when I setup the first bits I noticed it is very slow, something around 333ms for a whole screen to fill with characters.. I am wondering if there is a way to at least get ~20 fps? Here is my code: #include <stdio.h> #include <tchar.h> #include <Windows.h> #include <iostream> #include <array> #define WIDTH (100) #define HEIGHT (35) bool SetWindow(int Width, int Height) { _COORD coord; coord.X = Width; coord.Y = Height;