Have the following in native code, need to write in managed code:
HINSTANCE hUser = LoadLibrary("user32.dll"); /* Can't fail -- it's already loaded */
BOOL (*dpi)() = (BOOL (*)())GetProcAddress(hUser, "SetProcessDPIAware");
if(dpi) dpi();
The function SetProcessDPIAware does not exist on the lowest end platform we support, so we would run into loader problems simply declaring the function and trying to call it.
However, I have to make a runtime decision whether or not to call SetProcessDPIAware based on conditions other than operating system version so I cannot use a manifest.