WmiMonitorDescriptorMethods 类的 WmiGetMonitorRawEEdidV1Block 方法
WmiGetMonitorRawEEdidV1Block 方法获取指定视频电子标准协会的原始数据 (VESA) 增强型扩展显示标识数据 (E-EDID) 结构,该结构定义用于配置监视器的最佳设置。
语法
uint32 WmiGetMonitorRawEEdidV1Block(
[in] uint8 BlockId,
[out] uint8 BlockType,
[out] uint8 BlockContent[]
);
parameters
-
BlockId [in]
-
数据块标识。
-
BlockType [out]
-
数据块的类型。 下表列出了可能的返回值。
值 含义 - 0 (0x0)
未初始化 - 1 (0x1)
EDID 基块 - 2 (0x2)
EDID 块映射 - 255 (0xFF)
其他 -
BlockContent [out]
-
包含原始块内容的 128 字节数组。
返回值
返回零 (0) 以指示成功。 其他任何数字表示出现错误。 有关错误代码的详细信息,请参阅 WMI 错误常量 或 WbemErrorEnum。
示例
下面的代码示例将任何显示器的 EDID 块检索为原始 128 位数组。
static void Main(string[] args)
{
ManagementClass mc = new ManagementClass(string.Format(@"\\{0}\root\wmi:WmiMonitorDescriptorMethods", Environment.MachineName));
foreach (ManagementObject mo in mc.GetInstances()) //Do this for each connected monitor
{
for (int i = 0; i < 256; i++)
{
ManagementBaseObject inParams = mo.GetMethodParameters("WmiGetMonitorRawEEdidV1Block");
inParams["BlockId"] = i;
ManagementBaseObject outParams = null;
try
{
outParams = mo.InvokeMethod("WmiGetMonitorRawEEdidV1Block", inParams, null);
Console.Out.WriteLine("Returned a block of type {0}, having a content of type {1} ",
outParams["BlockType"], outParams["BlockContent"].GetType());
}
catch { break; } //No more EDID blocks
}
}
}
要求
要求 | 值 |
---|---|
最低受支持的客户端 |
Windows Vista |
最低受支持的服务器 |
Windows Server 2008 |
命名空间 |
Root\wmi |
MOF |
|
DLL |
|