All Questions
333
questions
4
votes
0
answers
75
views
Reading emojis using WinAPI console functions returns UTF-8 Replacement Character instead
For a project of mine I need to be able to read all possible MBCS UTF-8 codepoints from the Windows console. As it is well known that Windows works internally with wchar_t (UTF-16), I tried an ...
1
vote
1
answer
87
views
GetConsoleScreenBufferInfo returning wierd values when called using function
I have a program where I want to print out the size of the terminal window in columns and rows.
To do this I want to call this function from int main():
int getConsoleSize(){
...
0
votes
0
answers
79
views
Strange assertion in WinAPI when calling fclose on console handle
I am developing C++ shared library that is embedded as a plugin into my application using the Unity engine, and, possibly, into Qt applications (also developed by my company).
I want to allocate ...
1
vote
1
answer
97
views
Console attribute output is different when debugging and when running manually
I used the code from this example and changed it because I need to test the character grid.
#include <windows.h>
#include <stdio.h>
void write_symbol_in_color(HANDLE h, SHORT x, SHORT y, ...
1
vote
1
answer
134
views
How to properly and safely print to stdout/stderr using the Win32 API?
You may say.
//#DEFINE UNICODE
#include <Windows.h>
int main()
{
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
LPTSTR msg = TEXT("Hello, World!\n");
WriteConsole(hOut, ...
1
vote
0
answers
95
views
Writing lots of ANSI colored characters to the Console Screen Buffer is Slow
I am developing a 3D Console Application for fun and I have been using the basic Win32 Colors for a while but I wanted to upgrade to full color spectrum using ANSI. I have got color working, but the ...
0
votes
1
answer
99
views
Does FindWindowEx() work differently in Windows 11?
I was successfully using FindWindowEx() for getting a console window handle. The window search was conducted by window title. The problem is that this method stopped working in Windows 11.
Under ...
3
votes
1
answer
267
views
How to clear the console input buffer
I'm basically making my own console I/O, (so no cout, cin, etc) but sometimes when I read the input I don't read all the characters on the buffer, because I can select how much I want to read. But the ...
0
votes
0
answers
85
views
Console window crashes after resize
I am trying to make the matrix effect using only the Win32 API and the basic C++ libraries, inspired by the cmatrix command in linux.
So far I have succeeded in making it work for a specified screen ...
0
votes
0
answers
79
views
ShellExecuteEx with SEE_MASK_NO_CONSOLE behaves differently in Windows 10 or Windows 11?
I have a Win32 console app which can launch another console app using ShellExecuteEx.
The intention is for the launched app to inherit the parent's console, otherwise the observed behavior is a pop-up ...
1
vote
0
answers
65
views
Reparenting a console host window has rendering issues
I reparented the console window retrieved by AllocConsole() to a window owned by a different process using the following code:
SetParent(console, main_window_handle);
SetWindowLongPtr(console, ...
0
votes
0
answers
162
views
Size of the console window using the Windows API
I am trying to make a console tetris game. But have problem about the setting the window size of console.
I am using SetConsoleWindowInfo() method to resize the window. But it looks does not work. It ...
1
vote
1
answer
114
views
C++ Win32 GUI App, Console prompt overwrites previous logged text after program exit
Operating System is Windows 10.
The application is linked with /SUBSYSTEM:WINDOWS with a console Attached/Allocated and the Input/Output streams redirected like so:
void InitConsole()
{
if (...
3
votes
1
answer
491
views
Non documented Console Input Mode flags
I'm working on my library in Rust for making GUIs in terminals using Windows API.
While I implemented getting and setting the console mode, I noticed that for input mode the default value is 503. I ...
0
votes
0
answers
199
views
How can i handle error 233 from ReadConsoleInput in a program that uses windows console api?
I am programming a text editor in C using the Windows Console API.
Everything was working great until I updated my computer to Windows 11. I am getting error 233 (ERROR_PIPE_NOT_CONNECTED). First I ...