Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在C#中使用GetPhysicalMonitorsFromIDirect3DDevice9函数?_C#_Winapi - Fatal编程技术网

如何在C#中使用GetPhysicalMonitorsFromIDirect3DDevice9函数?

如何在C#中使用GetPhysicalMonitorsFromIDirect3DDevice9函数?,c#,winapi,C#,Winapi,我正试图使用C#中的SetMonitorBrightness函数来控制显示器的亮度 根据its,可以通过调用GetPhysicalMonitors fromMonitor或GetPhysicalMonitors fromIDirect3DDevice9函数来获取监视器句柄 我已经通过模仿这一点,使用GetPhysicalMonitorsFromHMONITOR编写了一个功能正常的C代码 现在,我在不同的计算机上测试了它,发现它在某些计算机上不起作用。我100%确信监视器支持DDC/CI或任何协议

我正试图使用C#中的
SetMonitorBrightness
函数来控制显示器的亮度

根据its,可以通过调用
GetPhysicalMonitors fromMonitor
GetPhysicalMonitors fromIDirect3DDevice9
函数来获取监视器句柄

我已经通过模仿这一点,使用
GetPhysicalMonitorsFromHMONITOR
编写了一个功能正常的C代码

现在,我在不同的计算机上测试了它,发现它在某些计算机上不起作用。我100%确信监视器支持DDC/CI或任何协议

回到过去,我的问题是:我如何使用替代方案

我只有一台显示器。我特别不知道如何获取指向Direct3D设备IDirect3DDevice9接口的指针,该接口可用于获取监视器句柄


如果您能提供C#中的示例代码,我将不胜感激。

您似乎可以调用API函数,那么您到底需要什么帮助?我几乎不知道这是如何从IDirect3DDevice9获取物理监视器的。这将返回一个监视器句柄,这正是我所需要的。但我不知道如何获取指向Direct3D设备的IDirect3DDevice9接口的指针,该接口是此函数所必需的。