IntPtr hscrdc =Win32Api.GetWindowDC(hWnd);
Win32Api.RECT rect;
Win32Api.GetWindowRect(hWnd,out rect);
这里的 Win32Api 需要引用什么类??????新手
------解决思路----------------------
直接DllImport
[StructLayout(LayoutKind.Sequential)]
private struct RECT{
internal int Left;
internal int Top;
internal int Right;
internal int Bottom;
}
[DllImport("user32.dll")]
private static extern int GetWindowDC (int hwnd);
下载一个ApiViewer 2004,系统的API基本上都可以查得到。直接DllImport就是了
------解决思路----------------------
[DllImport("user32.dll")]
private static extern int GetWindowRect (int hwnd, ref RECT lpRect);
------解决思路----------------------
API view里,选"Types"