Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#58 Attach to Console when GUI launched from CMD line

open
nobody
None
5
2013-08-06
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