diff --git a/Source/OpenTK/Platform/Windows/API.cs b/Source/OpenTK/Platform/Windows/API.cs index 42701067..b3bd58ec 100644 --- a/Source/OpenTK/Platform/Windows/API.cs +++ b/Source/OpenTK/Platform/Windows/API.cs @@ -49,6 +49,7 @@ namespace OpenTK.Platform.Windows using INT = System.Int32; using UINT = System.UInt32; using LONG_PTR = System.IntPtr; + using ATOM = System.Int32; using COLORREF = System.Int32; using RECT = OpenTK.Platform.Windows.Rectangle; @@ -74,6 +75,7 @@ namespace OpenTK.Platform.Windows RawInputDeviceInfoSize = Marshal.SizeOf(typeof(RawInputDeviceInfo)); PixelFormatDescriptorVersion = 1; PixelFormatDescriptorSize = (short)Marshal.SizeOf(typeof(PixelFormatDescriptor)); + WindowInfoSize = Marshal.SizeOf(typeof(WindowInfo)); } internal static readonly short PixelFormatDescriptorSize; @@ -84,6 +86,7 @@ namespace OpenTK.Platform.Windows internal static readonly int RawInputDeviceListSize; internal static readonly int RawInputDeviceInfoSize; internal static readonly int RawMouseSize; + internal static readonly int WindowInfoSize; } internal static class Functions @@ -677,6 +680,13 @@ namespace OpenTK.Platform.Windows #endregion + #region GetWindowInfo + + [DllImport("user32.dll"), SuppressUnmanagedCodeSecurity] + internal static extern BOOL GetWindowInfo(HWND hwnd, ref WindowInfo wi); + + #endregion + #endregion #region Display settings @@ -2393,6 +2403,58 @@ namespace OpenTK.Platform.Windows #endregion + #region WindowInfo + + /// + /// Contains window information. + /// + [StructLayout(LayoutKind.Sequential)] + struct WindowInfo + { + /// + /// The size of the structure, in bytes. + /// + public DWORD Size; + /// + /// Pointer to a RECT structure that specifies the coordinates of the window. + /// + public RECT Window; + /// + /// Pointer to a RECT structure that specifies the coordinates of the client area. + /// + public RECT Client; + /// + /// The window styles. For a table of window styles, see CreateWindowEx. + /// + public WindowStyle Style; + /// + /// The extended window styles. For a table of extended window styles, see CreateWindowEx. + /// + public ExtendedWindowStyle ExStyle; + /// + /// The window status. If this member is WS_ACTIVECAPTION, the window is active. Otherwise, this member is zero. + /// + public DWORD WindowStatus; + /// + /// The width of the window border, in pixels. + /// + public UINT WindowBordersX; + /// + /// The height of the window border, in pixels. + /// + public UINT WindowBordersY; + /// + /// The window class atom (see RegisterClass). + /// + public ATOM WindowType; + /// + /// The Microsoft Windows version of the application that created the window. + /// + public WORD CreatorVersion; + } + + #endregion + #endregion #region --- Enums ---