禁止Windows程序自适应比例缩放

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识别功能

猜你喜欢

转载自blog.csdn.net/u013015629/article/details/109140068