开发者

Changing LOCALE_SISO639LANGNAME for LOCALE_USER_DEFAULT

开发者 https://www.devze.com 2023-04-07 03:56 出处:网络
Is there a way to change \"LOCALE_SISO639LANGNAME\" on runtime? I would like to set another language for \"LOCALE_SI开发者_如何学编程SO639LANGNAME\" on runtime and when queried by \"GetLocaleInfo\",

Is there a way to change "LOCALE_SISO639LANGNAME" on runtime? I would like to set another language for "LOCALE_SI开发者_如何学编程SO639LANGNAME" on runtime and when queried by "GetLocaleInfo", it should be new language instead of system default. By the way, it seems, you can't set "LOCALE_SISO639LANGNAME" by using "SetLocaleInfo". Thank you in advance for your kind concern.


LOCALE_SISO639LANGNAME is a constant (C++ #define) so you cannot really change it on runtime. If I understand you correctly, you want to replace GetLocaleInfo calls with this value as a first argument so that effectively another argument is passed to the API.

It would not be a big deal if it was all in your code (code edit and binary rebuild could really do the job), and I can assume that you want this rather to have effect for something you only have in binary.

Provided that the guesswork above is correct, and especially you want it just for your process, you could perhaps hook GetLocaleInfo entry point and patch it in order to intercept the call and update arguments. It is not something easy or safe to use though, you will have to understand what you are doing.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号