OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Programming => Topic started by: Jochen Schäfer on July 08, 2021, 09:55:00 am

Title: Writing on console with WINDOWAPI
Post by: Jochen Schäfer on July 08, 2021, 09:55:00 am
Hi.

Does someone know a way to write on the console if the application is of type WINDOWAPI?
For my Featherpad port, I have the problem, that the help text emitted with -h on console doesn't show up, but seems to be captured with the console redirection.
Any ideas?
Title: Re: Writing on console with WINDOWAPI
Post by: Andi B. on July 08, 2021, 10:53:01 am
Compiling as console app which morphs itself to a winowing one at startup? There a a lot of apps which do that. Most probably an edm2 article too. Do you know about that or should I try to search for examples?

Edit: http://www.edm2.com/index.php/Dangers_with_morphing
http://www.edm2.com/index.php/Porting_SDL_applications_to_OS/2
Title: Re: Writing on console with WINDOWAPI
Post by: Jochen Schäfer on July 08, 2021, 01:33:17 pm
Yes, I know the trick and it seems that Qt5 itself does this, but if you start the application from WPS, you get a flashing shell. I want to avoid that.
Title: Re: Writing on console with WINDOWAPI
Post by: Rich Walsh on July 08, 2021, 03:56:00 pm
"featherpad 2>&1 | tee"  (using GNU tee)
or
"featherpad!s" (using Run!)
Title: Re: Writing on console with WINDOWAPI
Post by: Dave Yeo on July 08, 2021, 05:48:49 pm
Firefox does it by creating a console window, try doing x:\programs\firefox\firefox -help.
Probably not worth tracing down where the code to do that is as you just end up with a finished console window.
Title: Re: Writing on console with WINDOWAPI
Post by: Jochen Schäfer on July 09, 2021, 08:44:14 am
Probably something with the VIO API.