尝试访问远程处理时,ChangeDisplaySettings()失败

时间:2014-09-22 14:31:52

标签: c#

尝试旋转桌面,在远程桌面中运行代码时,我有例外:

  

尝试GetActiveDisplays()时出错:QueryDisplayConfig()失败。状态:InvalidParameter;

在本地运行它可以正常工作!

无法在远程桌面中执行此操作?

代码是:

var pathInfoArray = new DisplayConfigPathInfo[numPathArrayElements];
var modeInfoArray = new DisplayConfigModeInfo[numModeInfoArrayElements];

// topology ID only valid with QDC_DATABASE_CURRENT
var queryDisplayStatus = pathType == QueryDisplayFlags.DatabaseCurrent ?
CCDWrapper.QueryDisplayConfig(
pathType,
ref numPathArrayElements, pathInfoArray,
ref numModeInfoArrayElements, modeInfoArray, out topologyId) :

CCDWrapper.QueryDisplayConfig(
pathType,
ref numPathArrayElements, pathInfoArray,
ref numModeInfoArrayElements, modeInfoArray);

在远程桌面queryDisplayStatus上运行此操作会返回InvalidParameter

0 个答案:

没有答案