public static class WinAPI
{
[DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool GetWindowPlacement(IntPtr hWnd, out WINDOWPLACEMENT lpwndpl);
[DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetWindowPlacement(IntPtr hWnd,[In] ref WINDOWPLACEMENT lpwndpl);
public struct WINDOWPLACEMENT
{
public int length;
public int flags;
public int showCmd;
public System.Drawing.Point ptMinPosition;
public System.Drawing.Point ptMaxPosition;
public System.Drawing.Rectangle rcNormalPosition;
}
}在另一个类里面怎么使用这个GetWindowPlacement和SetWindowPlacement呢?
在另一个类里面似乎也无法定义一个变量成WINDOWPLACEMENT类型的
新手入门,在研究扩展别人的代码,请多照顾哈
{
[DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool GetWindowPlacement(IntPtr hWnd, out WINDOWPLACEMENT lpwndpl);
[DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetWindowPlacement(IntPtr hWnd,[In] ref WINDOWPLACEMENT lpwndpl);
public struct WINDOWPLACEMENT
{
public int length;
public int flags;
public int showCmd;
public System.Drawing.Point ptMinPosition;
public System.Drawing.Point ptMaxPosition;
public System.Drawing.Rectangle rcNormalPosition;
}
}在另一个类里面怎么使用这个GetWindowPlacement和SetWindowPlacement呢?
在另一个类里面似乎也无法定义一个变量成WINDOWPLACEMENT类型的
新手入门,在研究扩展别人的代码,请多照顾哈
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货