87 lines
1.6 KiB
C#
87 lines
1.6 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace CPF.ReoGrid.Utility
|
|
{
|
|
public static class NativeMethods
|
|
{
|
|
[DllImport("kernel32.dll", CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
|
|
public static extern IntPtr GlobalLock(IntPtr handle);
|
|
|
|
[DllImport("kernel32.dll", CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
|
|
public static extern bool GlobalUnlock(IntPtr handle);
|
|
|
|
private const string Kernel32 = "kernel32.dll";
|
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)]
|
|
public struct DEVMODE
|
|
{
|
|
private const int CCHDEVICENAME = 32;
|
|
|
|
private const int CCHFORMNAME = 32;
|
|
|
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
|
|
public string dmDeviceName;
|
|
|
|
public short dmSpecVersion;
|
|
|
|
public short dmDriverVersion;
|
|
|
|
public short dmSize;
|
|
|
|
public short dmDriverExtra;
|
|
|
|
public int dmFields;
|
|
|
|
public int dmPositionX;
|
|
|
|
public int dmPositionY;
|
|
|
|
public int dmDisplayOrientation;
|
|
|
|
public int dmDisplayFixedOutput;
|
|
|
|
public short dmColor;
|
|
|
|
public short dmDuplex;
|
|
|
|
public short dmYResolution;
|
|
|
|
public short dmTTOption;
|
|
|
|
public short dmCollate;
|
|
|
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
|
|
public string dmFormName;
|
|
|
|
public short dmLogPixels;
|
|
|
|
public int dmBitsPerPel;
|
|
|
|
public int dmPelsWidth;
|
|
|
|
public int dmPelsHeight;
|
|
|
|
public int dmDisplayFlags;
|
|
|
|
public int dmDisplayFrequency;
|
|
|
|
public int dmICMMethod;
|
|
|
|
public int dmICMIntent;
|
|
|
|
public int dmMediaType;
|
|
|
|
public int dmDitherType;
|
|
|
|
public int dmReserved1;
|
|
|
|
public int dmReserved2;
|
|
|
|
public int dmPanningWidth;
|
|
|
|
public int dmPanningHeight;
|
|
}
|
|
}
|
|
}
|