ColorProfileSetDisplayDefaultAssociation set the notebook with HDR is invalid in windows11

吕浩 1 Reputation point
2021-11-25T08:50:25.26+00:00

Code:

    DISPLAYCONFIG_TOPOLOGY_ID currentTopologyId;
    UINT32 requiredPaths, requiredModes;
    GetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &requiredPaths, &requiredModes);
    std::vector<DISPLAYCONFIG_PATH_INFO> paths(requiredPaths);
    std::vector<DISPLAYCONFIG_MODE_INFO> modes(requiredModes);
    QueryDisplayConfig(QDC_DATABASE_CURRENT, &requiredPaths, paths.data(), &requiredModes, modes.data(), &currentTopologyId);

    for (const auto & path : paths) {
        auto res = ColorProfileSetDisplayDefaultAssociation(
            WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER,
            icc,
            CPT_ICC,
            CPST_PERCEPTUAL,
            path.targetInfo.adapterId,
            path.sourceInfo.id
        );
}

Use this api setting to return successfully, but does not take effect.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,592 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,422 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,527 questions
{count} votes