Minimizing the Console Window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Abelard

    #1

    Minimizing the Console Window

    How do I programmaticall y minimize the console window in a VB .NET console
    application?
  • Spam Catcher

    #2
    Re: Minimizing the Console Window

    =?Utf-8?B?QWJlbGFyZA= =?= <Abelard@discus sions.microsoft .comwrote in
    news:F6E21274-9538-469A-967F-8963275DCA2D@mi crosoft.com:
    How do I programmaticall y minimize the console window in a VB .NET
    console application?
    I don't think you can - since it's not a window.



    Comment

    • Abelard

      #3
      Re: Minimizing the Console Window

      It is a window and can be minimized manually by clicking the minimize box.
      The question is how to programmaticall y minimize it.

      "Spam Catcher" wrote:
      =?Utf-8?B?QWJlbGFyZA= =?= <Abelard@discus sions.microsoft .comwrote in
      news:F6E21274-9538-469A-967F-8963275DCA2D@mi crosoft.com:
      >
      How do I programmaticall y minimize the console window in a VB .NET
      console application?
      >
      I don't think you can - since it's not a window.
      >
      >
      >
      >

      Comment

      • Miro

        #4
        Re: Minimizing the Console Window

        I think you would have to do this through the process of the "console
        window" that holds ur dos app.

        take a look at this link:


        Miro

        "Abelard" <Abelard@discus sions.microsoft .comwrote in message
        news:80D2D829-1DD9-4E63-9CEA-3F63A50845DF@mi crosoft.com...
        It is a window and can be minimized manually by clicking the minimize box.
        The question is how to programmaticall y minimize it.
        >
        "Spam Catcher" wrote:
        >
        >=?Utf-8?B?QWJlbGFyZA= =?= <Abelard@discus sions.microsoft .comwrote in
        >news:F6E2127 4-9538-469A-967F-8963275DCA2D@mi crosoft.com:
        >>
        How do I programmaticall y minimize the console window in a VB .NET
        console application?
        >>
        >I don't think you can - since it's not a window.
        >>
        >>
        >>
        >>

        Comment

        • Spam Catcher

          #5
          Re: Minimizing the Console Window

          =?Utf-8?B?QWJlbGFyZA= =?= <Abelard@discus sions.microsoft .comwrote in
          news:80D2D829-1DD9-4E63-9CEA-3F63A50845DF@mi crosoft.com:
          It is a window and can be minimized manually by clicking the minimize
          box. The question is how to programmaticall y minimize it.
          It maybe look like a Window but it is merely a container for the console
          application. Unlike Winforms application console apps do not have direct
          control over their windows.

          You'll have to use Win32 API calls to minimize the Window:


          Comment

          • zacks@construction-imaging.com

            #6
            Re: Minimizing the Console Window


            Abelard wrote:
            It is a window and can be minimized manually by clicking the minimize box.
            The question is how to programmaticall y minimize it.
            The problem is that the way you do it programatically in a Windows
            Application project is by setting the Me.WindowState to Minimized. But
            the WindowState property is defined in the System.Windows. Forms class
            and a Console Application window is not a member of the
            Systems.Windows .Forms class. To make things even worse, there is no
            Console.WindowS tate property.

            Now, I happen to agree with you, a console window is essentially a
            Command Prompt window that is running a specific piece of code. And you
            can minimize a Command Prompt (and a Console App) window by clicking on
            the minimize button, so there should be some way to do it
            programmaticall y, but I haven't found it. Maybe there is an API call to
            do it? (Since .NET I try to avoid API calls whenever possible.)
            >
            "Spam Catcher" wrote:
            >
            =?Utf-8?B?QWJlbGFyZA= =?= <Abelard@discus sions.microsoft .comwrote in
            news:F6E21274-9538-469A-967F-8963275DCA2D@mi crosoft.com:
            How do I programmaticall y minimize the console window in a VB .NET
            console application?
            I don't think you can - since it's not a window.


            Comment

            • Abelard

              #7
              Re: Minimizing the Console Window



              "Miro" wrote:
              I think you would have to do this through the process of the "console
              window" that holds ur dos app.
              >
              take a look at this link:

              >
              Miro
              >
              "Abelard" <Abelard@discus sions.microsoft .comwrote in message
              news:80D2D829-1DD9-4E63-9CEA-3F63A50845DF@mi crosoft.com...
              It is a window and can be minimized manually by clicking the minimize box.
              The question is how to programmaticall y minimize it.

              "Spam Catcher" wrote:
              =?Utf-8?B?QWJlbGFyZA= =?= <Abelard@discus sions.microsoft .comwrote in
              news:F6E21274-9538-469A-967F-8963275DCA2D@mi crosoft.com:
              >
              How do I programmaticall y minimize the console window in a VB .NET
              console application?
              >
              I don't think you can - since it's not a window.
              >
              >
              >
              >
              >
              >
              >

              Comment

              • Abelard

                #8
                Re: Minimizing the Console Window

                Thanks to all of yoh for your input. The link below had exactly the answer I
                needed. The console is a true window. You have to do a call to this
                function with all the correct parameters to control its behavior:

                Imports System.Diagnost ics

                Private Declare Function ShowWindow Lib "user32.dll " ( _
                ByVal hWnd As IntPtr, _
                ByVal nCmdShow As SHOW_WINDOW _
                ) As Boolean

                The link Miro sent has the rest of the details. It's very nice code and a
                generally
                useful function.

                "Miro" wrote:
                I think you would have to do this through the process of the "console
                window" that holds ur dos app.
                >
                take a look at this link:

                >
                Miro
                >
                "Abelard" <Abelard@discus sions.microsoft .comwrote in message
                news:80D2D829-1DD9-4E63-9CEA-3F63A50845DF@mi crosoft.com...
                It is a window and can be minimized manually by clicking the minimize box.
                The question is how to programmaticall y minimize it.

                "Spam Catcher" wrote:
                =?Utf-8?B?QWJlbGFyZA= =?= <Abelard@discus sions.microsoft .comwrote in
                news:F6E21274-9538-469A-967F-8963275DCA2D@mi crosoft.com:
                >
                How do I programmaticall y minimize the console window in a VB .NET
                console application?
                >
                I don't think you can - since it's not a window.
                >
                >
                >
                >
                >
                >
                >

                Comment

                Working...