Impact of Windows Edition vs. Version on API Functionality (e.g., SetWindowDisplayAffinity)

Viet Nguyen Ho 0 Reputation points
2024-11-21T08:57:07.0433333+00:00

Dear Microsoft Support Team,

I am a developer working with Windows APIs in C#. Recently, I've encountered an issue related to the use of certain functions and their compatibility with different versions and editions of Windows.

Background:

I am using the SetWindowDisplayAffinity function (via DllImport from user32.dll) in my C# application. I noticed that when running the application on Windows 10 without the latest updates (specific version unknown), the function does not work as expected or throws errors. However, after updating Windows 10 to version 22H2, the issue is resolved.

My understanding is that certain flags or features of Windows functions may only be supported in specific Windows versions (e.g., version 2004 or later for certain flags in SetWindowDisplayAffinity).

Question:

Is the functionality and availability of Windows API functions like SetWindowDisplayAffinity (and other similar functions) affected by the edition of Windows (Home, Pro, Enterprise), or are they only affected by the version (e.g., 1909, 2004, 21H1, 22H2)?

In other words, can I expect that all editions of Windows 10 and Windows 11 (Home, Pro, Enterprise) support the same set of Windows API functions, provided they are running the same version (build number)? Or are there differences in API availability or functionality between different editions?

Purpose:

I want to ensure that my application will function correctly across different editions of Windows, and understand if I need to account for any differences in API support based on the edition.

Request:

Could you please provide official clarification or direct me to documentation that explains whether Windows API functions are influenced by the Windows edition or solely by the Windows version? Any guidance on best practices for ensuring compatibility across different editions and versions would be greatly appreciated.

Thank you for your assistance.

Best regards,

VietNH

VietNH@fpt.com

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,774 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,666 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,013 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.