Try this test console application class, it will minimize the app, sleep two
seconds, then restore it.
using System;
using System.IO;
namespace ConsoleApplication1
{
class Class1
{
[System.Runtime.InteropServices.DllImport("user32.d ll")]
private static extern bool ShowWindow( IntPtr hWnd, int nCmdShow);
private const int SW_MINIMIZE = 6;
private const int SW_MAXIMIZE = 3;
private const int SW_RESTORE = 9;
[STAThread]
static void Main(string[] args)
{
IntPtr winHandle =
System.Diagnostics.Process.GetCurrentProcess().Mai nWindowHandle;
ShowWindow( winHandle, SW_MINIMIZE);
System.Threading.Thread.Sleep(2000);
ShowWindow( winHandle, SW_RESTORE);
}
}
}
"GG" <gg@hotmail.com> wrote in message
news:ep**************@tk2msftngp13.phx.gbl...
Is there a way to minimize my current console app?
Using this code but does not work
System.Diagnostics.Process
currentProcess=System.Diagnostics.Process.GetCurre ntProcess();
currentProcess.StartInfo.WindowStyle=System.Diagno stics.ProcessWindowSty
le.Minimized;
Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!