Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

před 8 měsíci
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. }