Schon eine Weile, seit ich irgendein Programm so alil rusty gemacht habe. Ich habe Code erforscht, um andere Anwendungen zu maximieren und zu minimieren. Also habe ich etwas Grundlegendes gefunden und hier ist was ich habe, etwas modifiziert vom Original. Er wollte, dass ich eine FindWindow-Methode erstelle, die ich gemacht habe. Jetzt sieht alles gut aus und ich habe versucht, es auszuführen und eine Nachricht zu bekommen. Ich bin mir nicht sicher, wo ich von hier aus hingehen soll. Der ursprüngliche Thread, in dem ich es fand, erwähnte dies nicht.Maximieren/minimieren andere Anwendungen
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();
}