Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4337370
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:56:06+00:00 2026-05-21T10:56:06+00:00

Is it possible to enumerate all the currently available keyboard layouts. By available I

  • 0

Is it possible to enumerate all the currently available keyboard layouts. By available I mean the user can switch to them by pressing Alt+Shift (or whatever his chosen shortcut is), i.e. they are in the Language Bar’s menu.

Alternatively, checking if a specific layout is available in the Language Bar would also be useful.


Edit:

Many thanks to @oleg, I finally made a function that works:

bool IsActiveKeyboardLayout(DWORD dwPrimaryLangID)
{
    TCHAR buf[KL_NAMELENGTH];
    GetKeyboardLayoutName(buf);

    DWORD dwActiveLangID = 0;
    _stscanf(buf, _T("%X"), &dwActiveLangID);
    if (dwPrimaryLangID == PRIMARYLANGID(dwActiveLangID))
        return true;

    return false;
}

bool IsKeyboardLayoutPresent(DWORD dwPrimaryLangID) 
{
    if (IsActiveKeyboardLayout(dwPrimaryLangID))
        return true;

    DWORD dwThreadID = GetCurrentThreadId();
    HKL hOld = GetKeyboardLayout(dwThreadID);
    for (;;)
    {
        ActivateKeyboardLayout((HKL) HKL_NEXT, 0);
        if (hOld == GetKeyboardLayout(dwThreadID))
            return false;

        if (IsActiveKeyboardLayout(dwPrimaryLangID))
        {
            ActivateKeyboardLayout(hOld, 0);
            return true;
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:56:07+00:00Added an answer on May 21, 2026 at 10:56 am

    The function GetKeyboardLayoutList seems get most close information to what you need. The returned information is the array of HKL, the HANDLE has values like

    0x04070407 – German
    0x04110411 – Japanese
    0x04190419 – Russian
    0xe0200411 – Japanese

    If you have for some language more as one input methods or more as one layout for one language you can have more items as you can see in the language bar menu. On 64-bit operation system the value 0x04070407 will be represented as 0x0000000004070407.

    Here you can read more about the input locale identifier and keyboard layouts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I enumerate all possible instances of System.Char ? I need to see
Possible Duplicate: How do I enumerate all time zones in .NET? How can I
Is it possible to enumerate which types that is available in a generic constraint?
Is it possible to enumerate all main menu items of other programs on Windows?
I'm writing a service application that needs to enumerate all current user sessions, and
Possible Duplicate: Enumerate NSArray using blocks to find and store all indexe's of all
Is it possible to enumerate all URL Schemes registered on an iOS device at
I want to enumerate all possible combinations of elements array. For example: I have
Is it possible to enumerate all the displays supported by an Android device? The
Is it possible to enumerate all the current errors being displayed through an Error

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.