CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2000
    Posts
    18

    win32 console & windowless

    HI ,
    I want to write a windows-32 bit console application (simple exe application).
    but i don's want to see the BLACK DOS SCREEN in front of me.
    remember i don't want to develop a NT-Service, it's going to be simple executable
    without any windows, just i want to see it's execution only in task bar.
    do u have any idea how to hide the dos window or do u know which book i have
    to refer ( i had seen it once in a book, but i forgot in which book.) get back me
    Regards,
    BALAJI


  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: win32 console & windowless

    Simple. Don't write a console app. Write a Windows app with no main window. The easiest way to do this is to write an Win32 API application (not MFC) with just an empty WinMain(). It's just like creating a console program, except that you are really writing a GUI app with no main window.

    Regards,

    Paul McKenzie


  3. #3
    Join Date
    May 2011
    Posts
    2

    Re: win32 console & windowless

    With all due respect, Paul, it's NOT that simple.

    Yes, if all you want is to execute a piece of code (without a window), you're correct: Make it a WINDOWS application (that simply doesn't "show" a window).

    HOWEVER, if you want to SCRIPT it (run it from a BATCH file, or interactively through the cmd window) - the INVOKING (cmd window) WAITS until the program invoked FINISHED (presumably so the %ERRORLEVEL% can be evaluated).

    WINDOWS applications run as "independent" applications (they're not expected to "return" anything).

    Yes, you CAN invoke them with a "START /WAIT MyApp.exe", which will FORCE the wait, the Windows Application DOESN'T behave the same way as a Console Application.

  4. #4
    Join Date
    Jan 2002
    Location
    Houston, TX
    Posts
    1,421

    Re: win32 console & windowless

    Not bad for a 12-year old thread!
    Be sure to rate those who help!
    -------------------------------------------------------------
    Karl - WK5M
    PP-ASEL-IA (N43CS)
    PGP Key: 0xDB02E193
    PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

  5. #5
    Join Date
    May 2002
    Location
    Lindenhurst, NY
    Posts
    867

    Re: win32 console & windowless

    Check his history. Looks like we'll hear from him again in another year resurrecting another zombie thread to post another 'with all due respect...' comment. See ya next year WardMD

  6. #6
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: win32 console & windowless

    @WardMD:

    With all due respect, please do not resurrect (very) old threads!

    [ Thread closed ]
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured