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

Jochen Schäfer

  • Full Member
  • ***
  • Thank You
  • -Given: 21
  • -Receive: 17
  • Posts: 169
  • Karma: +13/-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
  • *****
  • Thank You
  • -Given: 1
  • -Receive: 28
  • Posts: 592
  • Karma: +7/-1
    • 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

  • Full Member
  • ***
  • Thank You
  • -Given: 21
  • -Receive: 17
  • Posts: 169
  • Karma: +13/-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

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 14
  • Posts: 147
  • Karma: +2/-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
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 226
  • Posts: 3155
  • Karma: +59/-0
    • 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

  • Full Member
  • ***
  • Thank You
  • -Given: 21
  • -Receive: 17
  • Posts: 169
  • Karma: +13/-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.