SetProcessDpiAwarenessContext is fine to use, but as docs say it will work only for Win10 version.
When you include <windows.h> it only declares functions for specific windows version you are targeting.
If you are ok with unconditionally targeting Windows 10, then you can simply set define to enable Win10 functions in windows header files:
(do this before any windows include, or simply in cl.exe arguments)
If you want to support older Windows version, you will need to declare function pointer to this function and load it dynamically with LoadLibrary/GetProcAddress.
On older Windows versions you can do similar functionality with
SetProcessDpiAwareness (Win 8.1 and up) or
SetProcessDpiAware (Vista and up).
Alternative to all this code is to declare your DPI stuff in application manifest, then no extra code will be needed:
Setting default awareness with the application manifest