Console hide

This is a discussion on Console hide within the Windows Programming forums, part of the Platform Specific Boards category; I have a console program and I want to hide the console window when it executes. The only place it ...

  1. #1
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    375

    Console hide

    I have a console program and I want to hide the console window when it executes. The only place it should be terminated must be the task managerís processes window. How can I accomplish this?
    I'm using XP.
    Please help.
    Thanks.

  2. #2
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    If you never want the console to be displayed at all, why use a console program? Create a Win32 program, and simply don't create any windows or end the program. Eg:
    Code:
    #include <windows.h>
    
    int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
    {
        do
        {} while(1);
    
        return 0;
    }
    When the program is run, nothing will show up on the screen, and you will only be able end it through the task manager. If you actually do want a console to which you can output text, it's possible to spawn a console through a Win32 program. Have a look at AllocConsole.
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to hide output in a console
    By thelimpkid in forum C++ Programming
    Replies: 6
    Last Post: 09-02-2007, 07:50 AM
  2. hide console
    By sniper22 in forum C++ Programming
    Replies: 4
    Last Post: 03-13-2006, 10:30 AM
  3. Console App., Hide specific folder
    By nextstep in forum C++ Programming
    Replies: 10
    Last Post: 03-28-2005, 04:28 AM
  4. How to hide cursor in a Linux/Unix console?
    By Aidman in forum Linux Programming
    Replies: 2
    Last Post: 09-01-2004, 02:25 PM
  5. how to hide the console program?
    By sqlin in forum C++ Programming
    Replies: 2
    Last Post: 04-28-2003, 07:32 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21