復制代碼 代碼如下:
using System.Runtime.InteropServices;
復制代碼 代碼如下:
[DllImport("user32.dll")]
private static extern int GetWindowRect(IntPtr hwnd,out Rect lpRect);
復制代碼 代碼如下:
public struct Rect
{
public int Left;
public int Top;
public int Right;
public int Bottom;
}
演示代碼:
IntPtr hwnd = FindWindow("", "計算器");
Rect rect = new Rect();
GetWindowRect(hwnd, out lpRect);
新聞熱點
疑難解答
圖片精選