question

Hestia-1095 avatar image
0 Votes"
Hestia-1095 asked SimpleSamples answered

Windows Console API Problem

127359-ewew.pngi m traying to learn about the WindowsConsole API .. so i was testing the "CreatePseudoConsole()" function in the code . and it said that the function is undefined . can u help me please.

Rm:
functions like "SetConsoleWindowInfo()" work properly .


windows-api
ewew.png (50.2 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Does your environment cover the CreatePseudoConsole Requirements? such as Header and Minimum supported client.

0 Votes 0 ·

yep in . fact the other functions of the ConsoleAPI work proparly ..

0 Votes 0 ·
SimpleSamples avatar image
0 Votes"
SimpleSamples answered

See Windows Command-Line: Introducing the Windows Pseudo Console (ConPTY). It references microsoft/terminal: The new Windows Terminal and the original Windows console host, all in the same place!

Unless you understand the need for a Pseudo Console, you do not need CreatePseudoConsole. You do not need it for traditional Windows consoles. Pseudo Consoles are complicated.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Castorix31 avatar image
0 Votes"
Castorix31 answered Castorix31 commented

Are you sure that you added at beginning

 #include <ConsoleApi.h>

and that _WIN32_WINNT is sufficient ?

like before the include :

 #define  _WIN32_WINNT   0x0A00



· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

127691-capture.png


im using mingw64 8.1.0 win32 seh as a compiler127643-capture.png


0 Votes 0 ·
capture.png (24.4 KiB)
capture.png (3.5 KiB)

What is the value of _WIN32_WINNT ?

0 Votes 0 ·

define _WIN32_WINNT 0x0A00

0x0A00 is for win10
.. it does not work127624-capture.png


127558-capture.png


0 Votes 0 ·
capture.png (23.5 KiB)
capture.png (27.0 KiB)
Show more comments
SimpleSamples avatar image
1 Vote"
SimpleSamples answered

After posting my first response I found articles like Microsoft Developing a Pseudo-Console for Next Windows 10 Version. So Pseudo-Consoles are a major new development. There are instructions for working with them in:

I think it will be difficult for beginners to follow those instructions but you can try.

Off-topic comment: in the DevBlogs article (above) there is a picture of Admiral Grace Hopper. She is credited as having written the first computer compiler. The first. I actually met her once and I once was in her office but not while she was in it.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.