Win32.cs 859 B

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Runtime.InteropServices;
  3. using System.Windows;
  4. namespace Muchinfo.WPF.Controls.WebBrowser
  5. {
  6. internal static class Win32
  7. {
  8. [StructLayout(LayoutKind.Sequential)]
  9. public struct POINT
  10. {
  11. public int X;
  12. public int Y;
  13. public POINT(int x, int y)
  14. {
  15. this.X = x;
  16. this.Y = y;
  17. }
  18. public POINT(Point pt)
  19. {
  20. X = Convert.ToInt32(pt.X);
  21. Y = Convert.ToInt32(pt.Y);
  22. }
  23. };
  24. [DllImport("user32.dll")]
  25. internal static extern bool ClientToScreen(IntPtr hWnd, ref POINT lpPoint);
  26. [DllImport("user32.dll")]
  27. internal static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
  28. }
  29. }