posts - 0,  comments - 2,  trackbacks - 0

typedef DWORD
( NTAPI *NTQUERYDEFAULTLOCALE)(

  IN BOOLEAN              UserProfile,
  OUT PLCID               DefaultLocaleId );

typedef DWORD
( NTAPI *NTSETDEFAULTLOCALE)(

  IN BOOLEAN              UserProfile,
  IN LCID               DefaultLocaleId );


LCID lcid;
 DWORD dwTemp;
 NTQUERYDEFAULTLOCALE lpfnFunc = NULL;
 NTSETDEFAULTLOCALE lpfnFuncSet = NULL;
 HINSTANCE hCoreDll = LoadLibrary(TEXT("ntdll.dll"));
 if (hCoreDll)
 {
  lpfnFunc = (NTQUERYDEFAULTLOCALE)GetProcAddress(hCoreDll, _T("NtQueryDefaultLocale"));
  if (lpfnFunc)
  {
   lpfnFunc(TRUE, &lcid);
   CString sz;
   sz.Format("UserMode default locale is 0x%x", lcid);
   MessageBox(sz);
   lpfnFunc(FALSE,&lcid);
   sz.Format("system default locale is 0x%x", lcid);
   MessageBox(sz);
  }
  lpfnFuncSet = (NTSETDEFAULTLOCALE)GetProcAddress(hCoreDll, _T("NtSetDefaultLocale"));
  if (lpfnFuncSet)
  {
   dwTemp = lpfnFuncSet(FALSE, 0x409);
   if (dwTemp == 0)
    MessageBox(_T("set system locale to 0x809 successfully"));
  }
  FreeLibrary(hCoreDll);
 }

posted on 2008-10-27 09:48 Sean 阅读(330) 评论(0)  编辑 收藏 引用
只有注册用户登录后才能发表评论。
<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

hello! 欢迎常来我这里逛逛!

常用链接

留言簿(2)

文章分类(3)

文章档案(4)

相册

收藏夹(4)

搜索

  •  

最新评论