How to: Use the Windows SDK in a Windows Desktop application (2024)

  • Article

When you create a new classic Windows desktop project in Visual Studio, it targets the latest Windows SDK installed by Visual Studio by default. Visual Studio installs a version of the SDK when you install the C++ Desktop workload. The Windows SDK supports writing code for Windows 7 SP1 and later. For more information about targeting specific versions of Windows, see Using the Windows Headers and Update WINVER and _WIN32_WINNT.

When you upgrade an existing project, you have a choice: You can keep using the target Windows SDK specified in your project. Or, you can retarget your project to use the latest Windows SDK. With the latest Windows SDK, you get the advantages of support for the latest operating systems and language standards.

Use the right Windows SDK for your project

Starting with Visual Studio 2015, the C Runtime (CRT) library was separated into two parts: One part, ucrtbase, contains the Standard C and Microsoft-specific CRT functions that you can use in Universal Windows Apps. This library is now known as the Universal CRT, or UCRT, and has moved into the Windows SDK. The UCRT contains many new functions, such as C99 functions, needed to support the latest C++ language standards. The other part of the original CRT is vcruntime. It contains the C runtime support, startup, and termination code, and everything else that didn't go into the UCRT. The vcruntime library gets installed along with the C++ compiler and toolset in Visual Studio. For more information, see CRT library features.

The UCRT is now a system component that's installed on every version of Windows 10 and later. It's also available as an installable component for all earlier supported versions of Windows. You can use the Windows SDK to target all the supported versions of Windows. For a complete list of supported operating systems, see Windows SDK.

To retarget your projects to use the latest Windows SDK when you upgrade from a project version before Visual Studio 2015, follow these steps:

To target the latest Windows SDK

  1. Make sure the latest Windows SDK is installed. The Windows SDK is installed as part of the Desktop development with C++ workload in the Visual Studio Installer. A standalone version is available at Windows SDK.

  2. Open the shortcut menu for the project node, and choose Retarget projects. (In earlier versions of Visual Studio, choose Retarget SDK Version.) The Review Solution Actions dialog appears.

    How to: Use the Windows SDK in a Windows Desktop application (1)

  3. In the Target Platform Version dropdown list, choose the version of the Windows SDK you want to target. Generally speaking, we recommend you choose the latest installed version. Choose the OK button to apply the change.

    The 8.1 in this context refers to the Windows 8.1 SDK.

    If this step is successful, the following text appears in the Output window:

    Retargeting End: 1 completed, 0 failed, 0 skipped

  4. Open the project properties dialog. In the Configuration Properties > General section, notice the values of Windows Target Platform Version. Changing the value here has the same effect as following this procedure. For more information, see General Property Page (Project).

    How to: Use the Windows SDK in a Windows Desktop application (2)

    This action changes the values of project macros that include paths to header files and library files. To see what changed, open the Visual C++ Directories section of the Project Properties dialog. Select one of the properties, such as Include Directories. Then, open the property value's dropdown list, and choose <Edit>. The Include Directories dialog appears.

    How to: Use the Windows SDK in a Windows Desktop application (3)

    Choose the Macros >> button, and scroll down the list of macros to the Windows SDK macros to see all the new values.

    How to: Use the Windows SDK in a Windows Desktop application (4)

  5. Repeat the retargeting procedure for other solution projects, as needed, and rebuild the solution.

To target the Windows 8.1 SDK

  1. Open the shortcut menu for the project node in Solution Explorer, and choose Retarget projects. (In earlier versions of Visual Studio, choose Retarget SDK Version.)

  2. In the Target Platform Version dropdown list, choose 8.1.

See also

Walkthrough: Create a traditional Windows Desktop application (C++)

How to: Use the Windows SDK in a Windows Desktop application (2024)

FAQs

How to: Use the Windows SDK in a Windows Desktop application? ›

Use this SDK to build Universal Windows Platform (UWP) and Win32 applications for Windows 11, version 23H2 and previous Windows releases. The Windows App SDK provides a unified set of APIs and tools that are decoupled from the OS and released to developers via NuGet packages.

What can I do with Windows SDK? ›

Use this SDK to build Universal Windows Platform (UWP) and Win32 applications for Windows 11, version 23H2 and previous Windows releases. The Windows App SDK provides a unified set of APIs and tools that are decoupled from the OS and released to developers via NuGet packages.

What is the difference between Windows SDK and Windows App SDK? ›

The Windows App SDK doesn't replace the Windows SDK.

Instead, the Windows App SDK is a complement to the Windows SDK. It provides a convenient, OS-decoupled abstraction around the rich catalogue of Windows OS APIs that you can already access using the Windows SDK.

How to use Windows SDK in Visual Studio? ›

Select Extensions > Manage Extensions, search for Windows App SDK, and download the Windows App SDK extension. Close and reopen Visual Studio, and follow the prompts to install the extension.

How do I open Windows SDK from command prompt? ›

Select Start --> All Programs --> Microsoft Windows SDK v7. 1 and open Windows SDK 7.1 Command Prompt.

Is Windows SDK addon necessary? ›

The windows SDK is necessary if you intend to develop windows applications (with GUI, low-level graphics, windows filesystem specific I/O, tweaking registry settings, developing windows services or device drivers, etc etc).

Is Windows SDK installed by default? ›

Can you confirm where the SDK's install too please? Hello! By default, the Windows 10 SDK is installed into the “C:\Program Files (x86)\Windows Kits\10” folder.

Why use SDK instead of API? ›

When to use SDKs vs. APIs. You use APIs when you want to access functionality written by another developer through a suitable interface. You use an SDK when you want platform-specific tools to write code faster.

How do I know if Windows SDK is installed? ›

Under Configuration Properties > General, look for Windows SDK Version. For example, it might be 10 (latest installed version), which selects the most recent version if more than one version is installed. If you select the dropdown, you can see specific versions that Visual Studio has detected.

Where does Windows SDK install? ›

It targets Windows 10 version 1803 also known as Windows 10 April 2018 Update. The version number for that version of Windows is 10.0. 17134. The default install location for a Windows SDK is \Program Files\Windows Kits\10 on 32-bit systems and \Program Files (x86)\Windows Kits\10 on 64-bit systems.

What is Windows App SDK version? ›

Windows App SDK (formerly known as Project Reunion) is a software development kit (SDK) from Microsoft that provides a unified set of APIs and components that can be used to develop desktop applications for both Windows 11 and Windows 10 version 1809 and later.

How do I know if Visual Studio is installed? ›

Start Menu: Look for the Visual Studio icon in the Start menu. If you find it, Visual Studio is installed on your computer. Control Panel: Open the Control Panel, then go to "Programs and Features". If you see Microsoft Visual Studio in the list of installed programs, it is installed on your computer.

What is the benefit of using SDK? ›

SDKs are important because they allow app developers to create complex, multifunctional apps that meet the needs and expectations of their audience without wasting time and effort developing aspects of the app's function from scratch.

Is Windows SDK important? ›

The windows SDK is necessary if you intend to develop windows applications (with GUI, low-level graphics, windows filesystem specific I/O, tweaking registry settings, developing windows services or device drivers, etc etc).

What can you do with AWS SDK? ›

The AWS SDK for JavaScript simplifies use of AWS Services by providing a set of libraries that are consistent and familiar for JavaScript developers. It provides support for API lifecycle consideration such as credential management, retries, data marshaling, serialization, and deserialization.

Top Articles
Latest Posts
Article information

Author: Amb. Frankie Simonis

Last Updated:

Views: 5680

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Amb. Frankie Simonis

Birthday: 1998-02-19

Address: 64841 Delmar Isle, North Wiley, OR 74073

Phone: +17844167847676

Job: Forward IT Agent

Hobby: LARPing, Kitesurfing, Sewing, Digital arts, Sand art, Gardening, Dance

Introduction: My name is Amb. Frankie Simonis, I am a hilarious, enchanting, energetic, cooperative, innocent, cute, joyous person who loves writing and wants to share my knowledge and understanding with you.