📄 core.cs
字号:
private byte[] flatStruct = new byte[2 + 2 + 4 + MAXPNAMELEN * 2 + 4 + 2 + 2];
public byte[] ToByteArray()
{
return flatStruct;
}
public static implicit operator byte[]( WaveInCaps wic )
{
return wic.flatStruct;
}
public WaveInCaps()
{
Array.Clear(flatStruct, 0, flatStruct.Length);
}
public WaveInCaps( byte[] bytes ) : this( bytes, 0 )
{
}
public WaveInCaps( byte[] bytes, int offset )
{
Buffer.BlockCopy( bytes, offset, flatStruct, 0, flatStruct.Length );
}
public short MID
{
get
{
return BitConverter.ToInt16(flatStruct, wMIDOffset);
}
set
{
byte[] bytes = BitConverter.GetBytes( value );
Buffer.BlockCopy( bytes, 0, flatStruct, wMIDOffset, Marshal.SizeOf(value));
}
}
public short PID
{
get
{
return BitConverter.ToInt16(flatStruct, wPIDOffset);
}
set
{
byte[] bytes = BitConverter.GetBytes( value );
Buffer.BlockCopy( bytes, 0, flatStruct, wPIDOffset, Marshal.SizeOf(value));
}
}
public int DriverVersion
{
get
{
return BitConverter.ToInt32(flatStruct, vDriverVersionOffset);
}
set
{
byte[] bytes = BitConverter.GetBytes( value );
Buffer.BlockCopy( bytes, 0, flatStruct, vDriverVersionOffset, Marshal.SizeOf(value));
}
}
public string szPname
{
get
{
return Encoding.Unicode.GetString(flatStruct, szPnameOffset, MAXPNAMELEN * 2).Trim('\0');
}
}
public int Formats
{
get
{
return BitConverter.ToInt32(flatStruct, dwFormatsOffset);
}
set
{
byte[] bytes = BitConverter.GetBytes( value );
Buffer.BlockCopy( bytes, 0, flatStruct, dwFormatsOffset, Marshal.SizeOf(value));
}
}
public short Channels
{
get
{
return BitConverter.ToInt16(flatStruct, wChannelsOffset);
}
set
{
byte[] bytes = BitConverter.GetBytes( value );
Buffer.BlockCopy( bytes, 0, flatStruct, wChannelsOffset, Marshal.SizeOf(value));
}
}
public short wReserved1
{
get
{
return BitConverter.ToInt16(flatStruct, wReserved1Offset);
}
set
{
byte[] bytes = BitConverter.GetBytes( value );
Buffer.BlockCopy( bytes, 0, flatStruct, wReserved1Offset, Marshal.SizeOf(value));
}
}
}
#endregion
#region ProcessorArchitecture
/// <summary>
/// Processor Architecture values (GetSystemInfo)
/// </summary>
/// <seealso cref="M:OpenNETCF.WinAPI.Core.GetSystemInfo(OpenNETCF.WinAPI.Core.SYSTEM_INFO)"/>
[CLSCompliant(false)]
public enum ProcessorArchitecture : ushort
{
/// <summary>
/// Processor is Intel x86 based.
/// </summary>
Intel = 0,
/// <summary>
/// Processor is MIPS based.
/// </summary>
MIPS = 1,
/// <summary>
/// Processor is Alpha based.
/// </summary>
Alpha = 2,
/// <summary>
/// Processor is Power PC based.
/// </summary>
PPC = 3,
/// <summary>
/// Processor is SH3, SH4 etc.
/// </summary>
SHX = 4,
/// <summary>
/// Processor is ARM based.
/// </summary>
ARM = 5,
/// <summary>
/// Processor is Intel 64bit.
/// </summary>
IA64 = 6,
/// <summary>
/// Processor is Alpha 64bit.
/// </summary>
Alpha64 = 7,
/// <summary>
/// Unknown processor architecture.
/// </summary>
Unknown = 0xFFFF
}
#endregion
#region Processor Type
/// <summary>
/// Processor type values (GetSystemInfo)
/// </summary>
/// <seealso cref="M:OpenNETCF.Win32.Core.GetSystemInfo(OpenNETCF.Win32.Core.SYSTEM_INFO)"/>
public enum ProcessorType : int
{
/// <summary>
/// Processor is Intel 80386.
/// </summary>
Intel_386 = 386,
/// <summary>
/// Processor is Intel 80486.
/// </summary>
Intel_486 = 486,
/// <summary>
/// Processor is Intel Pentium (80586).
/// </summary>
Intel_Pentium = 586,
/// <summary>
/// Processor is Intel Pentium II (80686).
/// </summary>
Intel_PentiumII = 686,
/// <summary>
/// Processor is Intel 64bit (IA64).
/// </summary>
Intel_IA64 = 2200,
/// <summary>
/// Processor is MIPS R4000.
/// </summary>
MIPS_R4000 = 4000,
/// <summary>
/// Processor is Alpha 21064.
/// </summary>
Alpha_21064 = 21064,
/// <summary>
/// Processor is Power PC 403.
/// </summary>
PPC_403 = 403,
/// <summary>
/// Processor is Power PC 601.
/// </summary>
PPC_601 = 601,
/// <summary>
/// Processor is Power PC 603.
/// </summary>
PPC_603 = 603,
/// <summary>
/// Processor is Power PC 604.
/// </summary>
PPC_604 = 604,
/// <summary>
/// Processor is Power PC 620.
/// </summary>
PPC_620 = 620,
/// <summary>
/// Processor is Hitachi SH3.
/// </summary>
Hitachi_SH3 = 10003,
/// <summary>
/// Processor is Hitachi SH3E.
/// </summary>
Hitachi_SH3E = 10004,
/// <summary>
/// Processor is Hitachi SH4.
/// </summary>
Hitachi_SH4 = 10005,
/// <summary>
/// Processor is Motorola 821.
/// </summary>
Motorola_821 = 821,
/// <summary>
/// Processor is SH3.
/// </summary>
SHx_SH3 = 103,
/// <summary>
/// Processor is SH4.
/// </summary>
SHx_SH4 = 104,
/// <summary>
/// Processor is StrongARM.
/// </summary>
StrongARM = 2577,
/// <summary>
/// Processor is ARM 720.
/// </summary>
ARM720 = 1824,
/// <summary>
/// Processor is ARM 820.
/// </summary>
ARM820 = 2080,
/// <summary>
/// Processor is ARM 920.
/// </summary>
ARM920 = 2336,
/// <summary>
/// Processor is ARM 7 TDMI.
/// </summary>
ARM_7TDMI = 70001
}
#endregion
#region SystemInfo
/// <summary>
/// This structure contains information about the current computer system. This includes the processor type, page size, memory addresses, and OEM identifier.
/// </summary>
/// <seealso cref="GetSystemInfo"/>
public struct SystemInfo
{
/// <summary>
/// The system's processor architecture.
/// </summary>
[CLSCompliant(false)]
public ProcessorArchitecture wProcessorArchitecture;
internal ushort wReserved;
/// <summary>
/// The page size and the granularity of page protection and commitment.
/// </summary>
public int PageSize;
/// <summary>
/// Pointer to the lowest memory address accessible to applications and dynamic-link libraries (DLLs).
/// </summary>
public int MinimumApplicationAddress;
/// <summary>
/// Pointer to the highest memory address accessible to applications and DLLs.
/// </summary>
public int MaximumApplicationAddress;
/// <summary>
/// Specifies a mask representing the set of processors configured into the system. Bit 0 is processor 0; bit 31 is processor 31.
/// </summary>
public int ActiveProcessorMask;
/// <summary>
/// Specifies the number of processors in the system.
/// </summary>
public int NumberOfProcessors;
/// <summary>
/// Specifies the type of processor in the system.
/// </summary>
public ProcessorType ProcessorType;
/// <summary>
/// Specifies the granularity with which virtual memory is allocated.
/// </summary>
public int AllocationGranularity;
/// <summary>
/// Specifies the system抯 architecture-dependent processor level.
/// </summary>
public short ProcessorLevel;
/// <summary>
/// Specifies an architecture-dependent processor revision.
/// </summary>
public short ProcessorRevision;
}
#endregion
#region SystemParametersInfoAction Enumeration
/// <summary>
/// Specifies the system-wide parameter to query or set.
/// </summary>
public enum SystemParametersInfoAction : int
{
/// <summary>
/// Retrieves the two mouse threshold values and the mouse speed.
/// </summary>
GetMouse = 3,
/// <summary>
/// Sets the two mouse threshold values and the mouse speed.
/// </summary>
SetMouse = 4,
/// <summary>
/// For Windows CE 2.12 and later, sets the desktop wallpaper.
/// </summary>
SetDeskWallpaper = 20,
/// <summary>
///
/// </summary>
SetDeskPattern = 21,
/// <summary>
/// Sets the size of the work area
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -