尝试旋转桌面,在远程桌面中运行代码时,我有例外:
尝试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
。