3 #if SILICONSTUDIO_PLATFORM_WINDOWS_DESKTOP
5 using System.Runtime.InteropServices;
8 namespace SiliconStudio.Presentation.Extensions
10 public static class NativeHelper
14 [DllImport(
"user32.dll")]
15 [
return: MarshalAs(UnmanagedType.Bool)]
16 public static extern bool SetCursorPos(
int x,
int y);
18 [DllImport(
"user32.dll")]
19 public static extern int SetWindowLong(IntPtr hWnd,
int nIndex,
int dwNewLong);
21 [DllImport(
"user32.dll", SetLastError =
true)]
22 public static extern int GetWindowLong(IntPtr hWnd,
int nIndex);
24 [DllImport(
"user32.dll")]
25 public static extern IntPtr SetParent(IntPtr hWnd, IntPtr hWndParent);
27 [DllImport(
"user32.dll", SetLastError =
true)]
28 public static extern bool GetWindowRect(IntPtr hwnd, out RECT lpRect);
30 [DllImport(
"user32.dll", SetLastError =
true)]
31 public static extern IntPtr FindWindow(
string lpClassName,
string lpWindowName);
33 [DllImport(
"user32.dll")]
34 public static extern bool ShowWindow(IntPtr hWnd,
int mCmdShow);
36 [DllImport(
"user32.dll")]
37 public static extern IntPtr MonitorFromWindow(IntPtr hwnd,
int dwFlags);
39 [DllImport(
"user32.dll")]
40 public static extern bool GetMonitorInfo(IntPtr hmonitor, [In, Out] MONITORINFO monitorInfo);
48 [StructLayout(LayoutKind.Sequential)]
49 public struct MINMAXINFO
51 public POINT ptReserved;
52 public POINT ptMaxSize;
53 public POINT ptMaxPosition;
54 public POINT ptMinTrackSize;
55 public POINT ptMaxTrackSize;
58 [StructLayout(LayoutKind.Sequential)]
59 public class MONITORINFO
61 public int cbSize =
sizeof(int) * 10;
62 public RECT rcMonitor;
67 [StructLayout(LayoutKind.Sequential)]
72 public POINT(
int x,
int y)
79 [StructLayout(LayoutKind.Sequential)]
84 public RECT(
int left,
int top,
int right,
int bottom)
97 public const int GWL_STYLE = unchecked((
int)0xFFFFFFF0);
99 public const int MONITOR_DEFAULTTONULL = unchecked(0x00000000);
100 public const int MONITOR_DEFAULTTOPRIMARY = unchecked(0x00000001);
101 public const int MONITOR_DEFAULTTONEAREST = unchecked(0x00000002);
104 public const int WS_BORDER = unchecked(0x00800000);
105 public const int WS_CAPTION = unchecked(0x00C00000);
106 public const int WS_CHILD = unchecked(0x40000000);
107 public const int WS_CHILDWINDOW = unchecked(0x40000000);
108 public const int WS_CLIPCHILDREN = unchecked(0x02000000);
109 public const int WS_CLIPSIBLINGS = unchecked(0x04000000);
110 public const int WS_DISABLED = unchecked(0x08000000);
111 public const int WS_DLGFRAME = unchecked(0x00400000);
112 public const int WS_GROUP = unchecked(0x00020000);
113 public const int WS_HSCROLL = unchecked(0x00100000);
114 public const int WS_ICONIC = unchecked(0x20000000);
115 public const int WS_MAXIMIZE = unchecked(0x01000000);
116 public const int WS_MAXIMIZEBOX = unchecked(0x00010000);
117 public const int WS_MINIMIZE = unchecked(0x20000000);
118 public const int WS_MINIMIZEBOX = unchecked(0x00020000);
119 public const int WS_OVERLAPPED = unchecked(0x00000000);
120 public const int WS_OVERLAPPEDWINDOW = unchecked(WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX);
121 public const int WS_POPUP = unchecked((
int)0x80000000);
122 public const int WS_POPUPWINDOW = unchecked(WS_POPUP | WS_BORDER | WS_SYSMENU);
123 public const int WS_SIZEBOX = unchecked(0x00040000);
124 public const int WS_SYSMENU = unchecked(0x00080000);
125 public const int WS_TABSTOP = unchecked(0x00010000);
126 public const int WS_THICKFRAME = unchecked(0x00040000);
127 public const int WS_TILED = unchecked(0x00000000);
128 public const int WS_TILEDWINDOW = unchecked(WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX);
129 public const int WS_VISIBLE = unchecked(0x10000000);
130 public const int WS_VSCROLL = unchecked(0x00200000);
132 public const int SW_HIDE = unchecked(0x00000000);
137 public static bool SetCursorPos(
Point pt)
139 return SetCursorPos((
int)pt.X, (
int)pt.Y);
_In_ size_t _In_ DXGI_FORMAT _In_ size_t _In_ float size_t y
The child element is aligned to the bottom of the parent's layout slot.
The child element is aligned to the top of the parent's layout slot.
System.Windows.Point Point