Author Topic: Writing on console with WINDOWAPI  (Read 4502 times)

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +27/-0
    • View Profile
Writing on console with WINDOWAPI
« 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?

Andi B.

  • Hero Member
  • *****
  • Posts: 811
  • Karma: +11/-2
    • View Profile
Re: Writing on console with WINDOWAPI
« Reply #1 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
« Last Edit: July 08, 2021, 10:54:47 am by Andi B. »

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +27/-0
    • View Profile
Re: Writing on console with WINDOWAPI
« Reply #2 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.

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 331
  • Karma: +23/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Writing on console with WINDOWAPI
« Reply #3 on: July 08, 2021, 03:56:00 pm »
"featherpad 2>&1 | tee"  (using GNU tee)
or
"featherpad!s" (using Run!)

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Writing on console with WINDOWAPI
« Reply #4 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.

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +27/-0
    • View Profile
Re: Writing on console with WINDOWAPI
« Reply #5 on: July 09, 2021, 08:44:14 am »
Probably something with the VIO API.