не работает код, который должен скрыть окно notepad'a:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace ConsoleApplication7
{
class Program
{
public const int SW_HIDE=0;
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr SendMessage(IntPtr hWnd,
int msg, int wParam, int lParam);
static void Main(string[] args)
{
Process p = new Process();
p.StartInfo.FileName = "notepad.exe";
p.Start();
SendMessage(p.Handle,SW_HIDE,0,0);
Console.ReadLine();
}
}
}