Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
loadkeyboardlayout (user32)
 
.
Summary

C# Signature:

[DllImport("user32.dll")]
static extern IntPtr LoadKeyboardLayout(string pwszKLID, uint Flags);

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

set flags to 1 when trying to change language

set flags to 0 when trying to reverse the change

Sample Code:

LoadKeyboardLayout("00000429", 1);

//commen on 09 August 2010 by yazeed hamdan,

// This is not alternative, this will set the default input language based on installed keyboard layouts, if

//the layout is not installed in regional settings, nothing will happen, but with LoadKeyboardLayout, the input

//language will be installed if it doesnt exist in regional and language settings.

Alternative Managed API:

//switch to Persian(IR) language

InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(new System.Globalization.CultureInfo("fa-IR"));

//switch to English(US) language

InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(new System.Globalization.CultureInfo("En-US"));

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions