Click to See Complete Forum and Search --> : Input Language


amitapl
July 28th, 2005, 08:29 AM
Hello,
For a project I'm making I need to find out the current input language of the current active window

can anyone help?

Thanks,
Amit Apple

golanshahar
July 28th, 2005, 09:13 AM
you can try something like this:


HWND hWnd = ::GetForegroundWindow();

DWORD dw=0;
DWORD dwThreadID = ::GetWindowThreadProcessId( hWnd, &dw);

if( ::AttachThreadInput( ::GetCurrentThreadId(), dwThreadID, true ) )
{
char szLocaleName[MAX_PATH];

::GetLocaleInfo( ::GetThreadLocale(),
LOCALE_SLANGUAGE ,szLocaleName,MAX_PATH);

::AfxMessageBox(szLocaleName);

::AttachThreadInput( ::GetCurrentThreadId(), dwThreadID, false);
}



Cheers