25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

27 satır
797 B

  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. }