WINDOWPOS 構造が探しているもの だと思います。他のウィンドウ構造が役立つ場合があります。
一部の Google 検索では、WINDOWPOS を使用しない別の例が見つかりました。
1、API FindWindow() を呼び出してウィンドウ ハンドルを取得します (SPY++ を使用して ClassName と WindowName の 2 つのパラメーターを取得します)。
2、API GetWindowRect() を呼び出して、指定されたウィンドウのサイズと位置を取得します。
コードスニペット
[DllImport("user32.dll")]
private static extern IntPtr FindWindow(string className, string windowName);
[DllImport("user32.dll")]
private static extern int GetWindowRect(IntPtr hwnd, out Rectangle rect);
private void button2_Click(object sender, EventArgs e)
{
string className = "yourClassName";
string windowName = "yourWindowName";
Rectangle rect;
IntPtr hwnd = FindWindow(className, windowName);
GetWindowRect(hwnd, out rect);
}