基础知识

本文介绍了一种防止Windows应用程序UI自动放大的方法,通过调用SetProcessDPIAware函数来实现。此外,还提供了如何加载指定DLL文件的示例代码。

可用SetProcessDPIAware()防止UI自动放大,代码如下:

http://blog.163.com/bestfighter_210@126/blog/static/103618872012311184446/

http://blog.youkuaiyun.com/okdou/article/details/2916586

HMODULE hUser32 = LoadLibrary(_T("user32.dll"));

// handle dpi on aero
HMODULE hUser32 = LoadLibrary(_T("user32.dll"));
typedef BOOL (*SetProcessDPIAwareFunc)();
SetProcessDPIAwareFunc setDPIAware = (SetProcessDPIAwareFunc)GetProcAddress(hUser32, "SetProcessDPIAware");
if (setDPIAware) setDPIAware();
FreeLibrary(hUser32);

GetModuleFileName

http://baike.baidu.com/view/1285912.htm

获取一个已装载模板的完整路径名称 ,与函数 GetModuleFileNameExA略有不同.

获取 vnclang_server.dll方法

#define MAX_PATH          260

char szCurrentDir[MAX_PATH];
char szCurrentDir_vnclangdll[MAX_PATH];
if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
{
char* p = strrchr(szCurrentDir, '\\');
*p = '\0';
}
strcpy (szCurrentDir_vnclangdll,szCurrentDir);
strcat (szCurrentDir_vnclangdll,"\\");
strcat (szCurrentDir_vnclangdll,"vnclang_server.dll");

hInstResDLL = LoadLibrary(szCurrentDir_vnclangdll);

if (hInstResDLL == NULL)
{
hInstResDLL = hInstance;
}
// RegisterLinkLabel(hInstResDLL);

//Load all messages from ressource file
Load_Localization(hInstResDLL) ;

 

 

转载于:https://www.cnblogs.com/gisbeginner/archive/2012/11/07/2758254.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值