예제 #1
0
파일: WindowHelper.cs 프로젝트: neem/Nilas
 private static extern bool GetWindowPlacement(IntPtr hWnd, out WINDOWPLACEMENT lpwndpl);
예제 #2
0
파일: WindowHelper.cs 프로젝트: neem/Nilas
 public static string Save(Window window)
 {
     WINDOWPLACEMENT wp = new WINDOWPLACEMENT();
     IntPtr hwnd = new WindowInteropHelper(window).Handle;
     GetWindowPlacement(hwnd, out wp);
     int size = Marshal.SizeOf(typeof(WINDOWPLACEMENT));
     var buf = new byte[size];
     IntPtr p = Marshal.AllocHGlobal(size);
     Marshal.StructureToPtr(wp, p, true);
     Marshal.Copy(p, buf, 0, size);
     Marshal.FreeHGlobal(p);
     return Convert.ToBase64String(buf);
 }