Thread: Console hide

  1. #1
    Android geek@02's Avatar
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    470

    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.
    [email protected]
    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, 11:30 AM
  3. Console App., Hide specific folder
    By nextstep in forum C++ Programming
    Replies: 10
    Last Post: 03-28-2005, 05: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