|
|
@ -541,72 +541,72 @@ namespace Avalonia.Win32.Interop |
|
|
WM_DISPATCH_WORK_ITEM = WM_USER, |
|
|
WM_DISPATCH_WORK_ITEM = WM_USER, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public enum BitmapCompressionMode : uint |
|
|
public enum BitmapCompressionMode : uint |
|
|
{ |
|
|
{ |
|
|
BI_RGB = 0, |
|
|
BI_RGB = 0, |
|
|
BI_RLE8 = 1, |
|
|
BI_RLE8 = 1, |
|
|
BI_RLE4 = 2, |
|
|
BI_RLE4 = 2, |
|
|
BI_BITFIELDS = 3, |
|
|
BI_BITFIELDS = 3, |
|
|
BI_JPEG = 4, |
|
|
BI_JPEG = 4, |
|
|
BI_PNG = 5 |
|
|
BI_PNG = 5 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public enum DIBColorTable |
|
|
public enum DIBColorTable |
|
|
{ |
|
|
{ |
|
|
DIB_RGB_COLORS = 0, /* color table in RGBs */ |
|
|
DIB_RGB_COLORS = 0, /* color table in RGBs */ |
|
|
DIB_PAL_COLORS /* color table in palette indices */ |
|
|
DIB_PAL_COLORS /* color table in palette indices */ |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)] |
|
|
[StructLayout(LayoutKind.Sequential)] |
|
|
public struct RGBQUAD |
|
|
public struct RGBQUAD |
|
|
{ |
|
|
{ |
|
|
public byte rgbBlue; |
|
|
public byte rgbBlue; |
|
|
public byte rgbGreen; |
|
|
public byte rgbGreen; |
|
|
public byte rgbRed; |
|
|
public byte rgbRed; |
|
|
public byte rgbReserved; |
|
|
public byte rgbReserved; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)] |
|
|
[StructLayout(LayoutKind.Sequential)] |
|
|
public struct BITMAPINFO |
|
|
public struct BITMAPINFO |
|
|
{ |
|
|
{ |
|
|
// C# cannot inlay structs in structs so must expand directly here
|
|
|
// C# cannot inlay structs in structs so must expand directly here
|
|
|
//
|
|
|
//
|
|
|
//[StructLayout(LayoutKind.Sequential)]
|
|
|
//[StructLayout(LayoutKind.Sequential)]
|
|
|
//public struct BITMAPINFOHEADER
|
|
|
//public struct BITMAPINFOHEADER
|
|
|
//{
|
|
|
//{
|
|
|
public uint biSize; |
|
|
public uint biSize; |
|
|
public int biWidth; |
|
|
public int biWidth; |
|
|
public int biHeight; |
|
|
public int biHeight; |
|
|
public ushort biPlanes; |
|
|
public ushort biPlanes; |
|
|
public ushort biBitCount; |
|
|
public ushort biBitCount; |
|
|
public BitmapCompressionMode biCompression; |
|
|
public BitmapCompressionMode biCompression; |
|
|
public uint biSizeImage; |
|
|
public uint biSizeImage; |
|
|
public int biXPelsPerMeter; |
|
|
public int biXPelsPerMeter; |
|
|
public int biYPelsPerMeter; |
|
|
public int biYPelsPerMeter; |
|
|
public uint biClrUsed; |
|
|
public uint biClrUsed; |
|
|
public uint biClrImportant; |
|
|
public uint biClrImportant; |
|
|
//}
|
|
|
//}
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] |
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] |
|
|
public uint[] cols; |
|
|
public uint[] cols; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public const int SizeOf_BITMAPINFOHEADER = 40; |
|
|
public const int SizeOf_BITMAPINFOHEADER = 40; |
|
|
|
|
|
|
|
|
[DllImport("user32.dll", SetLastError = true)] |
|
|
[DllImport("user32.dll", SetLastError = true)] |
|
|
public static extern IntPtr GetDC(IntPtr hWnd); |
|
|
public static extern IntPtr GetDC(IntPtr hWnd); |
|
|
|
|
|
|
|
|
[DllImport("gdi32.dll")] |
|
|
[DllImport("gdi32.dll")] |
|
|
public static extern int SetDIBitsToDevice(IntPtr hdc, int XDest, int YDest, |
|
|
public static extern int SetDIBitsToDevice(IntPtr hdc, int XDest, int YDest, |
|
|
uint dwWidth, uint dwHeight, |
|
|
uint dwWidth, uint dwHeight, |
|
|
int XSrc, int YSrc, |
|
|
int XSrc, int YSrc, |
|
|
uint uStartScan, uint cScanLines, |
|
|
uint uStartScan, uint cScanLines, |
|
|
IntPtr lpvBits, [In] ref BITMAPINFO lpbmi, uint fuColorUse); |
|
|
IntPtr lpvBits, [In] ref BITMAPINFO lpbmi, uint fuColorUse); |
|
|
|
|
|
|
|
|
[DllImport("user32.dll")] |
|
|
[DllImport("user32.dll")] |
|
|
public static extern bool ReleaseDC(IntPtr hWnd, IntPtr hDC); |
|
|
public static extern bool ReleaseDC(IntPtr hWnd, IntPtr hDC); |
|
|
|
|
|
|
|
|
[DllImport("user32.dll", SetLastError = true)] |
|
|
[DllImport("user32.dll", SetLastError = true)] |
|
|
public static extern bool AdjustWindowRectEx(ref RECT lpRect, uint dwStyle, bool bMenu, uint dwExStyle); |
|
|
public static extern bool AdjustWindowRectEx(ref RECT lpRect, uint dwStyle, bool bMenu, uint dwExStyle); |
|
|
|
|
|
|
|
|
[DllImport("user32.dll")] |
|
|
[DllImport("user32.dll")] |
|
|
@ -845,6 +845,10 @@ namespace Avalonia.Win32.Interop |
|
|
[DllImport("user32.dll")] |
|
|
[DllImport("user32.dll")] |
|
|
public static extern IntPtr MonitorFromWindow(IntPtr hwnd, MONITOR dwFlags); |
|
|
public static extern IntPtr MonitorFromWindow(IntPtr hwnd, MONITOR dwFlags); |
|
|
|
|
|
|
|
|
|
|
|
[return: MarshalAs(UnmanagedType.Bool)] |
|
|
|
|
|
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] |
|
|
|
|
|
static extern bool PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); |
|
|
|
|
|
|
|
|
public enum MONITOR |
|
|
public enum MONITOR |
|
|
{ |
|
|
{ |
|
|
MONITOR_DEFAULTTONULL = 0x00000000, |
|
|
MONITOR_DEFAULTTONULL = 0x00000000, |
|
|
@ -1008,6 +1012,12 @@ namespace Avalonia.Win32.Interop |
|
|
E_OUTOFMEMORY = 0x8007000E |
|
|
E_OUTOFMEMORY = 0x8007000E |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public enum Icons |
|
|
|
|
|
{ |
|
|
|
|
|
ICON_SMALL = 0, |
|
|
|
|
|
ICON_BIG = 1 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public const uint SIGDN_FILESYSPATH = 0x80058000; |
|
|
public const uint SIGDN_FILESYSPATH = 0x80058000; |
|
|
|
|
|
|
|
|
[Flags] |
|
|
[Flags] |
|
|
|