Prev: How to resolve the ftLastWriteTime field bug of FtpFindFirstFile in wininet.dll?
Next: How to abort FindFirstFile or FindNextFile when taking too long
From: Sa3Q on 12 Nov 2009 07:04 Hi. I want a piece of code (c++ code or c) which will tell me what is current selected language in windows. When you have 2-3 languages installed in your Windows, when you change keyboard layout with shortcut like Alt+shift or with any other method and press keys and type a word, I want to determine language. I need global function, not for determining language in current form or window, I want to determine for example if user is typing in Notepad with Arabic or Turkish or english language, I want to know current language which user is typing on or the language id. Thanks from now!
From: Christian ASTOR on 12 Nov 2009 07:24 On 12 nov, 13:04, Sa3Q <s3qs...(a)gmail.com> wrote: > I want a piece of code (c++ code or c) which will tell me what is > current selected language in windows. > > When you have 2-3 languages installed in your Windows, when you change > keyboard layout with shortcut like Alt+shift or with any other method > and press keys and type a word, I want to determine language. For this, GetKeyboardLayout() ( ITfInputProcessorProfiles also)
From: Sa3Q on 12 Nov 2009 07:38 On 12 ÙÙÙ٠بر, 14:24, Christian ASTOR <casto....(a)club-internet.fr> wrote: > On 12 nov, 13:04, Sa3Q <s3qs...(a)gmail.com> wrote: > > > I want a piece of code (c++ code or c) which will tell me what is > > current selected language in windows. > > > When you have 2-3 languages installed in your Windows, when you change > > keyboard layout with shortcut like Alt+shift or with any other method > > and press keys and type a word, I want to determine language. > > For this, GetKeyboardLayout() ( ITfInputProcessorProfiles also) ============================ can you give me example
From: Sa3Q on 12 Nov 2009 08:25 On 12 ÙÙÙ٠بر, 14:38, Sa3Q <s3qs...(a)gmail.com> wrote: > On 12 ÙÙÙ٠بر, 14:24, Christian ASTOR <casto....(a)club-internet.fr> > wrote:> On 12 nov, 13:04, Sa3Q <s3qs...(a)gmail.com> wrote: > > > > I want a piece of code (c++ code or c) which will tell me what is > > > current selected language in windows. > > > > When you have 2-3 languages installed in your Windows, when you change > > > keyboard layout with shortcut like Alt+shift or with any other method > > > and press keys and type a word, I want to determine language. > > > For this, GetKeyboardLayout() ( ITfInputProcessorProfiles also) > > ============================ > can  you give me example ==================================================== i use GetKeyboardLayout(0) but it return only one number F0280401 please can you explain
From: Christian ASTOR on 12 Nov 2009 09:04
On 12 nov, 14:25, Sa3Q <s3qs...(a)gmail.com> wrote: > i use GetKeyboardLayout(0) > but it return only one number > F0280401 > please can you explain 0 is for current thread... You can do, in a timer or a worker thread : HWND hWndFW = GetForegroundWindow(); DWORD dwThreadId = GetWindowThreadProcessId(hWndFW, NULL); HKL h = GetKeyboardLayout(dwThreadId); LANGID langid = LANGID(LOWORD(HandleToLong(h))); |