How to use void HideConsole() ??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cosmos22
    New Member
    • Feb 2008
    • 9

    How to use void HideConsole() ??

    The following code for me doesn't work, I want to hide the console window in the easiest possible way:

    void HideConsole();
    {
    ShowWindow(GetC onsoleHwnd(),SW _HIDE);
    }


    I used this ref.
    This document provides a template for creating a basic graphical user interface (GUI) application that can be used with a Windows console application. It includes preprocessor directives, global variables, function prototypes, and implementations for basic GUI functions like setting the background color and handling button clicks. The template demonstrates how to add hover text for buttons and set up a message loop to process GUI messages until the application is closed.



    It states GetConsoleHwnd( is undeclared, any ideas?
    void HideConsole(); on its own doesn't work at all...


    Thanks all!
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    It means GetConsoleHwnd( ) is not a Win32 function.

    You may have to use FindWindow() instead.

    Comment

    • Studlyami
      Recognized Expert Contributor
      • Sep 2007
      • 464

      #3
      Heres a reference on how to get the console hwnd using find window. Hopes this helps.

      Comment

      Working...