|
1 | 1 | --- |
2 | | -title: "How to: Use the Windows 10 SDK in a Windows Desktop Application" |
| 2 | +title: "How to: Use the Windows 10 SDK in a Windows Desktop application" |
| 3 | +description: "How to set the target SDK version in a Windows Desktop application project to use the Windows 10 SDK." |
3 | 4 | ms.custom: "get-started-article" |
4 | | -ms.date: "07/12/2018" |
| 5 | +ms.date: "01/22/2020" |
5 | 6 | ms.assetid: eed6421e-9355-44a6-9582-3f1d453a6d44 |
6 | 7 | --- |
7 | | -# How to: Use the Windows 10 SDK in a Windows Desktop Application |
| 8 | +# How to: Use the Windows 10 SDK in a Windows Desktop application |
8 | 9 |
|
9 | | -When you create a classic Windows desktop project in Visual Studio 2017, it is set up by default to build with the version of the Windows 10 SDK that was installed when the C++ Desktop workload was installed or last updated. This version of the Windows SDK is compatible with Windows 7 and later. See [Using the Windows Headers](/windows/win32/WinProg/using-the-windows-headers) for more information about targeting specific versions of Windows. |
| 10 | +When you create a new classic Windows desktop project in Visual Studio, it targets the Windows 10 SDK by default. Visual Studio installs a version of this SDK when you install the C++ Desktop workload. The Windows 10 SDK supports writing code for Windows 7 SP1 and later. For more information about targeting specific versions of Windows, see [Using the Windows Headers](/windows/win32/WinProg/using-the-windows-headers) and [Update WINVER and _WIN32_WINNT](../porting/modifying-winver-and-win32-winnt.md). |
10 | 11 |
|
11 | | -If you want to target an earlier version of the SDK, you can open **Project | Properties** and choose from the other SDK versions available in the Windows SDK Version dropdown. |
| 12 | +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 Windows 10 SDK. With the Windows 10 SDK, you get the advantages of support for the latest operating systems and language standards. |
12 | 13 |
|
13 | | -Starting with Visual Studio 2015 and the Windows 10 SDK, the CRT library was separated into two parts, one (ucrtbase) that contains the functions that are acceptable to be used in Universal Windows Apps, and one that contains everything else (vcruntime140). Since the Windows 10 SDK contains new functions, such as many C99 functions, you need to follow these steps in order to use those functions. See [CRT Library Features](../c-runtime-library/crt-library-features.md). |
| 14 | +## Use the right Windows SDK for your project |
14 | 15 |
|
15 | | -### To target the Windows 10 SDK |
| 16 | +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 10 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](../c-runtime-library/crt-library-features.md). |
16 | 17 |
|
17 | | -1. Make sure the Windows 10 SDK is installed. The Windows 10 SDK is installed as part of the **Desktop development with C++** workload. A standalone version is available at [Downloads and tools for Windows 10](https://developer.microsoft.com/windows/downloads). |
| 18 | +The UCRT is now a system component that's installed on every version of Windows 10. It's also available as an installable component for all earlier supported versions of Windows. You can use the Windows 10 SDK to target all the supported versions of Windows. For a complete list of supported operating systems, see [Windows 10 SDK](https://developer.microsoft.com/windows/downloads/windows-10-sdk). |
18 | 19 |
|
19 | | -2. Open the shortcut menu for the project node, and choose **Retarget SDK Version**. |
| 20 | +To retarget your projects to use the Windows 10 SDK when you upgrade from a project version before Visual Studio 2015, follow these steps: |
20 | 21 |
|
21 | | -  |
| 22 | +### To target the Windows 10 SDK |
| 23 | + |
| 24 | +1. Make sure the Windows 10 SDK is installed. The Windows 10 SDK is installed as part of the **Desktop development with C++** workload. A standalone version is available at [Downloads and tools for Windows 10](https://developer.microsoft.com/windows/downloads). |
22 | 25 |
|
23 | | - The **Review Solution Actions** dialog appears. |
| 26 | +1. 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. |
24 | 27 |
|
25 | 28 |  |
26 | 29 |
|
27 | | -3. In the **Target Platform Version** dropdown list, choose the version of the Windows 10 SDK you want to target. Choose the OK button to apply the change. |
| 30 | +1. In the **Target Platform Version** dropdown list, choose the version of the Windows 10 SDK you want to target. Generally speaking, we recommend you choose the latest installed version. Choose the **OK** button to apply the change. |
28 | 31 |
|
29 | | - Note that 8.1 in this context refers to the Windows SDK version, which is also backwardly compatible with Windows 8, Windows Server 2012, Windows 7, Windows Server 2008, and Windows Vista. |
| 32 | + The 8.1 in this context refers to the Windows 8.1 SDK. |
30 | 33 |
|
31 | 34 | If this step is successful, the following text appears in the Output window: |
32 | 35 |
|
33 | 36 | `Retargeting End: 1 completed, 0 failed, 0 skipped` |
34 | 37 |
|
35 | | -4. Open the project properties, and 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. See [General Property Page (Project)](../build/reference/general-property-page-project.md). |
| 38 | +1. 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)](../build/reference/general-property-page-project.md). |
36 | 39 |
|
37 | 40 |  |
38 | 41 |
|
39 | | - This action changes the values of project macros that include paths to header files and library files. To see what changed, in the **Visual C++ Directories** section of the **Project Properties** dialog, choose one of the properties such as the **Include Directories**, choose to open the dropdown list, and choose \<Edit>. The **Include Directories** dialog appears. |
| 42 | + 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. |
40 | 43 |
|
41 | 44 |  |
42 | 45 |
|
43 | 46 | Choose the **Macros >>** button, and scroll down the list of macros to the Windows SDK macros to see all the new values. |
44 | 47 |
|
45 | 48 |  |
46 | 49 |
|
47 | | -5. Repeat for other projects, as needed, and rebuild the solution. |
| 50 | +1. Repeat the retargeting procedure for other solution projects, as needed, and rebuild the solution. |
48 | 51 |
|
49 | 52 | ### To target the Windows 8.1 SDK |
50 | 53 |
|
51 | | -1. Open the shortcut menu for the project node, and choose **Retarget SDK Version**. |
| 54 | +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**.) |
52 | 55 |
|
53 | 56 | 2. In the **Target Platform Version** dropdown list, choose **8.1**. |
54 | 57 |
|
55 | 58 | ## See also |
56 | 59 |
|
57 | | -[Windows Desktop Applications (Visual C++)](../windows/how-to-use-the-windows-10-sdk-in-a-windows-desktop-application.md) |
| 60 | +[Walkthrough: Create a traditional Windows Desktop application (C++)](../windows/walkthrough-creating-windows-desktop-applications-cpp.md) |
0 commit comments