2
过了一段时间,因为我做任何程序如此生锈。我正在研究代码来最大化和最小化其他应用程序。所以我找到了一些基本的东西,这是我的东西,从原来的东西稍微修改一下。它希望我生成一些我所做的FindWindow方法。现在一切看起来不错,我试图运行它,得到一个消息。不知道该从哪里出发。我发现它的原始线程没有提到这一点。最大化/最小化其他应用程序
private const int SW_SHOWNORMAL = 1;
private const int SW_SHOWMINIMIZED = 2;
private const int SW_SHOWMAXIMIZED = 3;
[DllImport("user32.dll")]
private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
static void Main(string[] args)
{
// retrieve Notepad main window handle
IntPtr hWnd = FindWindow("Notepad", "Untitled - Notepad");
if (!hWnd.Equals(IntPtr.Zero))
{
// SW_SHOWMAXIMIZED to maximize the window
// SW_SHOWMINIMIZED to minimize the window
// SW_SHOWNORMAL to make the window be normal size
ShowWindowAsync(hWnd, SW_SHOWMAXIMIZED);
}
}
private static IntPtr FindWindow(string p, string p_2)
{
throw new NotImplementedException();
}