复制代码 代码如下:
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);
新闻热点
疑难解答
图片精选