User32QueryDisplayConfig(QueryDisplayConfigFlags, UInt32, DisplayConfigPathInfo, UInt32, DisplayConfigModeInfo, DisplayConfigTopologyId) Method

Retrieves information about all possible display paths for all display devices, or views, in the current setting.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", ExactSpelling = true)]
public static Win32ErrorCode QueryDisplayConfig(
	QueryDisplayConfigFlags flags,
	ref uint refPathInfoArrayCount,
	DisplayConfigPathInfo[] pathInfoArray,
	ref uint refModeInfoArrayCount,
	DisplayConfigModeInfo[] modeInfoArray,
	out DisplayConfigTopologyId currentTopologyId
)

Parameters

flags  QueryDisplayConfigFlags
The type of information to retrieve.
refPathInfoArrayCount  UInt32
The number of elements in pathInfoArray parameter.

This parameter cannot be .

If QueryDisplayConfig(QueryDisplayConfigFlags, UInt32, DisplayConfigPathInfo, UInt32, DisplayConfigModeInfo, DisplayConfigTopologyId) returns ERROR_SUCCESS, refPathInfoArrayCount is updated with the number of valid entries in pathInfoArray.

pathInfoArray  DisplayConfigPathInfo
An array of DisplayConfigPathInfo elements.

Each element in pathInfoArray describes a single path from a source to a target.

The source and target mode information indexes are only valid in combination with the modeInfoArray tables that are returned for the API at the same time.

This parameter can be .

The pathInfoArray is always returned in path priority order.

refModeInfoArrayCount  UInt32
The number of elements in modeInfoArray parameter.

This parameter can be .

If QueryDisplayConfig(QueryDisplayConfigFlags, UInt32, DisplayConfigPathInfo, UInt32, DisplayConfigModeInfo, DisplayConfigTopologyId) returns ERROR_SUCCESS, refModeInfoArrayCount is updated with the number of valid entries in modeInfoArray.

modeInfoArray  DisplayConfigModeInfo
An array of DisplayConfigModeInfo elements.

This parameter can be .

currentTopologyId  DisplayConfigTopologyId
A variable that receives the identifier of the currently active topology in the CCD database.

The currentTopologyId parameter is only set when the flags parameter value is DatabaseCurrent.

If the flags parameter value is set to DatabaseCurrent, the currentTopologyId parameter must not be Null.

If the flags parameter value is not set to DatabaseCurrent, the currentTopologyId parameter value must be Null.

Return Value

Win32ErrorCode
The function returns one of the following return codes.

ERROR_SUCCESS: The function succeeded.

ERROR_INVALID_PARAMETER: The combination of parameters and flags specified is invalid.

ERROR_NOT_SUPPORTED: The system is not running a graphics driver that was written according to the Windows Display Driver Model (WDDM). The function is only supported on a system with a WDDM driver running.

ERROR_ACCESS_DENIED: The caller does not have access to the console session. This error occurs if the calling process does not have access to the current desktop or is running on a remote session.

ERROR_GEN_FAILURE: An unspecified error occurred.

ERROR_INSUFFICIENT_BUFFER: The supplied path and mode buffer are too small.

Remarks

See Also