Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

8 mesi fa
1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace DamnOverSharp.Helpers
  4. {
  5. internal static class WindowHelper
  6. {
  7. [DllImport("user32.dll")]
  8. private static extern bool GetWindowRect(IntPtr hwnd, ref Rect rectangle);
  9. public struct Rect
  10. {
  11. public int Left { get; set; }
  12. public int Top { get; set; }
  13. public int Right { get; set; }
  14. public int Bottom { get; set; }
  15. }
  16. public static System.Windows.Rect GetWindowRectangle(IntPtr windowHandle)
  17. {
  18. Rect result = new Rect();
  19. GetWindowRect(windowHandle, ref result);
  20. return new System.Windows.Rect(result.Left, result.Top, result.Right - result.Left, result.Bottom - result.Top);
  21. }
  22. }
  23. }