I never have done that myself and on linux it might be complicated because it depends on the graphical environment (KDE, Gnome, ...).
For windows you can have a look at http://msdn.microsoft.com/en-us/libr...=VS.85%29.aspx: ActivateKeyboardLayout, GetKeyboardLayout and GetKeyboardLayoutList.
Bookmarks