读书人

求封闭显卡硬件加速的API 或者实现代码

发布时间: 2012-08-10 12:19:33 作者: rapoo

求关闭显卡硬件加速的API 或者实现代码
右键单击桌面→属性→设置→高级→疑难解答
可以设置硬件加速

但是我需要在程序里动态关闭硬件加速
安装时修改注册表也可(但是我发现硬件加速的注册表项在不同电脑上的几乎全部不同)

求一个可以对之操作的API
要是没有API给个能实现的代码即可(操作注册表也可)

最好是C/C++代码

[解决办法]
通过修改注册表,可以实现关闭硬件加速~
[解决办法]
关硬件加速,我记得应该是固定的一个键值啊~~代码在家里电脑上,具体记不清了~~
[解决办法]
用regmon监视dxdiag设置打开/关闭硬件加速时修改的注册表项?
[解决办法]
去NVIDIA网站下载控制面板nvcpl.dll里的API说明文档吧.
应该有这样的API.
[解决办法]
这种都是用wmi的

修改注册表最没技术含量了
[解决办法]
http://developer.download.nvidia.com/SDK/9.5/Samples/DEMOS/common/NvCpl.zip
[解决办法]

It works as follows:

(1) Find out the position of the current video device, information on this may be found in the registry, here:
\\HKLM\HARDWARE\DEVICEMAP\VIDEO\Device\Video0
There you will find a LPSTR type of entry, pointing to a registry key for the current video device, e.g.
"\Registry\Machine\System\ControlSet001\Services\G400\Device0"
(2) Parse that string, replacing "\Registry\Machine" with HKLM (HKEY_LOCAL_MACHINE) and open the corresponding registry key,
(3) Look for a DWORD value "Acceleration.Level". If the value does not exists, hardware acceleration is set to "Full". Otherwise, "Acceleration.Level" may be one of 0x1 to 0x5, 0x5 meaning "No Acceleration", and 0x1 meaning "All but cursor acceleration" (see "Extended Display Settings").
(4) Set the desired acceleration level, or delete the entry to set "Full" acceleration mode.
(5) Let Windows reload the display settings by using the following code:

DEVMODE devMode;
BOOL success = ::EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devMode);
if (success == TRUE)
{
LONG result = ::ChangeDisplaySettings(&devMode, CDS_RESET);
printf("ChangeDisplaySettings() returned: %d\n", result);
}

First, the current display settings are loaded into the devMode variable, and then, the displayed is forced to perform a reset; at this occasion, the "Acceleration.Level" value is read out from the registry and the new acceleration level is set.

不过使用WMI比修改注册表要好很多,可以参考这段VBS:
http://www.edugeek.net/wiki/index.php?title=Set_Hardware_Acceleration_Level

读书人网 >VC/MFC

热点推荐