|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Minimizing the Console WindowHow do I programmatically minimize the console window in a VB .NET console
application? =?Utf-8?B?QWJlbGFyZA==?= <Abel***@discussions.microsoft.com> wrote in
news:F6E21274-9538-469A-967F-8963275DCA2D@microsoft.com: I don't think you can - since it's not a window.> How do I programmatically minimize the console window in a VB .NET > console application? It is a window and can be minimized manually by clicking the minimize box.
The question is how to programmatically minimize it. Show quoteHide quote "Spam Catcher" wrote: > =?Utf-8?B?QWJlbGFyZA==?= <Abel***@discussions.microsoft.com> wrote in > news:F6E21274-9538-469A-967F-8963275DCA2D@microsoft.com: > > > How do I programmatically minimize the console window in a VB .NET > > console application? > > I don't think you can - since it's not a 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: http://www.thescripts.com/forum/thread382333.html Miro Show quoteHide quote "Abelard" <Abel***@discussions.microsoft.com> wrote in message news:80D2D829-1DD9-4E63-9CEA-3F63A50845DF@microsoft.com... > It is a window and can be minimized manually by clicking the minimize box. > The question is how to programmatically minimize it. > > "Spam Catcher" wrote: > >> =?Utf-8?B?QWJlbGFyZA==?= <Abel***@discussions.microsoft.com> wrote in >> news:F6E21274-9538-469A-967F-8963275DCA2D@microsoft.com: >> >> > How do I programmatically minimize the console window in a VB .NET >> > console application? >> >> I don't think you can - since it's not a window. >> >> >> >>
Show quote
Hide quote
"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: > http://www.thescripts.com/forum/thread382333.html > > Miro > > "Abelard" <Abel***@discussions.microsoft.com> wrote in message > news:80D2D829-1DD9-4E63-9CEA-3F63A50845DF@microsoft.com... > > It is a window and can be minimized manually by clicking the minimize box. > > The question is how to programmatically minimize it. > > > > "Spam Catcher" wrote: > > > >> =?Utf-8?B?QWJlbGFyZA==?= <Abel***@discussions.microsoft.com> wrote in > >> news:F6E21274-9538-469A-967F-8963275DCA2D@microsoft.com: > >> > >> > How do I programmatically minimize the console window in a VB .NET > >> > console application? > >> > >> I don't think you can - since it's not a 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.Diagnostics 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. Show quoteHide quote "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: > http://www.thescripts.com/forum/thread382333.html > > Miro > > "Abelard" <Abel***@discussions.microsoft.com> wrote in message > news:80D2D829-1DD9-4E63-9CEA-3F63A50845DF@microsoft.com... > > It is a window and can be minimized manually by clicking the minimize box. > > The question is how to programmatically minimize it. > > > > "Spam Catcher" wrote: > > > >> =?Utf-8?B?QWJlbGFyZA==?= <Abel***@discussions.microsoft.com> wrote in > >> news:F6E21274-9538-469A-967F-8963275DCA2D@microsoft.com: > >> > >> > How do I programmatically minimize the console window in a VB .NET > >> > console application? > >> > >> I don't think you can - since it's not a window. > >> > >> > >> > >> > > > =?Utf-8?B?QWJlbGFyZA==?= <Abel***@discussions.microsoft.com> wrote in
news:80D2D829-1DD9-4E63-9CEA-3F63A50845DF@microsoft.com: It maybe look like a Window but it is merely a container for the console > It is a window and can be minimized manually by clicking the minimize > box. The question is how to programmatically minimize it. 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: http://www.pinvoke.net/default.aspx/user32/ShowWindow.html Abelard wrote:
> It is a window and can be minimized manually by clicking the minimize box. The problem is that the way you do it programatically in a Windows> The question is how to programmatically minimize it. 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.WindowState 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 programmatically, 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.) Show quoteHide quote > > "Spam Catcher" wrote: > > > =?Utf-8?B?QWJlbGFyZA==?= <Abel***@discussions.microsoft.com> wrote in > > news:F6E21274-9538-469A-967F-8963275DCA2D@microsoft.com: > > > > > How do I programmatically minimize the console window in a VB .NET > > > console application? > > > > I don't think you can - since it's not a window. > > > > > > > >
Prevent form minimize
Threading a ShowDialog? - progress form. is there any way to find the position of mouse click on a form SQL datasources dialog to choose folder in vb .net 2005 Why return false? Command Prompt or Windows OPEN A FILE FOR READ ONLY How To Redistribute Office 2003 DLLS SQL datasources |
|||||||||||||||||||||||