#58 Attach to Console when GUI launched from CMD line

Next Release
open
None
7
2014-08-03
2011-03-07
Justin Murray
No

When a GUI mode executable is started from cmd.exe, it is possible for the application to attach itself to the parent console, and use it to display stdout text. This can be done using the Windows API function AttachConsole(). I have attached a working patch for guihead.c that worked well for my application.

Discussion

  • Justin Murray
    Justin Murray
    2011-03-07

    Patched to use AttachConsole()

     
    Attachments
  • Justin Murray
    Justin Murray
    2011-03-07

    The resulting patched object file

     
    Attachments
  • Justin Murray
    Justin Murray
    2011-03-07

    This should be linked to Artifact #2835541

     
  • gohai
    gohai
    2014-08-03

    Is there any plan to get this patch included in official launch4j releases? I am working with the Processing Project (http://processing.org/), and having recently switched to launch4j for our standalone applications applications on Windows, we would want to have this functionality, but being developed by a lot of volunteers in their spare time, we don't have the manpower to maintain a custom lauch4j build ourselves. Thanks!

     
  • Grzegorz Kowal
    Grzegorz Kowal
    2014-08-03

    • assigned_to: Grzegorz Kowal
    • Group: --> Next Release
    • Priority: 5 --> 7
     
  • Grzegorz Kowal
    Grzegorz Kowal
    2014-08-03

    Hi, yes. I'll add it in the next release. I had a problem last time I've tried it, I need to look at it again.

    Grzegorz

     
  • gohai
    gohai
    2014-08-03

    Thanks Grzegorz, much appreciated.