1.调用SetProcessDPIAware
HINSTANCE hUser32 = LoadLibrary(L"User32.dll");
if (hUser32)
{
typedef BOOL (WINAPI* LPSetProcessDPIAware)(void);
LPSetProcessDPIAware pSetProcessDPIAware = (LPSetProcessDPIAware)GetProcAddress(hUser32, "SetProcessDPIAware");
if (pSetProcessDPIAware)
{
pSetProcessDPIAware();
}
FreeLibrary(hUser32);
}
2.VS设置启用DPI识别功能