Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Language Installed in OS

Language Installed in OS

Scheduled Pinned Locked Moved C / C++ / MFC
jsontutorialquestion
9 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kiranin
    wrote on last edited by
    #1

    How to find the language installed or Language package exists or language in OS will support or not? I failed to use GetUILanguage and EnumUILangauges API's. Any suggestions?

    _ L 2 Replies Last reply
    0
    • K kiranin

      How to find the language installed or Language package exists or language in OS will support or not? I failed to use GetUILanguage and EnumUILangauges API's. Any suggestions?

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      What problems did you face with using EnumUILanguages.

      «_Superman_» I love work. It gives me something to do between weekends.

      K 1 Reply Last reply
      0
      • _ _Superman_

        What problems did you face with using EnumUILanguages.

        «_Superman_» I love work. It gives me something to do between weekends.

        K Offline
        K Offline
        kiranin
        wrote on last edited by
        #3

        Actually i didn't understand how to use the API, and also i didn't find any sample for it :). If you can help me on how to use this API it will be very useful for myself.

        _ 1 Reply Last reply
        0
        • K kiranin

          Actually i didn't understand how to use the API, and also i didn't find any sample for it :). If you can help me on how to use this API it will be very useful for myself.

          _ Offline
          _ Offline
          _Superman_
          wrote on last edited by
          #4

          Here goes -

          BOOL CALLBACK EnumUILanguagesProc(
          LPTSTR lpUILanguageString,
          LONG_PTR lParam
          )
          {
          MessageBox(0, lpUILanguageString, 0, 0);
          return TRUE;
          }

          int main()
          {
          EnumUILanguages(EnumUILanguagesProc, MUI_LANGUAGE_NAME, 0);
          }

          If you want the language id instead of the language name, replace MUI_LANGUAGE_NAME with MUI_LANGUAGE_ID.

          «_Superman_» I love work. It gives me something to do between weekends.

          1 Reply Last reply
          0
          • K kiranin

            How to find the language installed or Language package exists or language in OS will support or not? I failed to use GetUILanguage and EnumUILangauges API's. Any suggestions?

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            To check if the operating system supports the language I believe that you can just call the IsValidLanguageGroup Function[^] Such as:BOOL bSupported = IsValidLanguageGroup(LGRPID_INDIC,LGRPID_SUPPORTED); BOOL bInstalled = IsValidLanguageGroup(LGRPID_INDIC,LGRPID_INSTALLED);
            Best Wishes. -David Delaune

            K 1 Reply Last reply
            0
            • L Lost User

              To check if the operating system supports the language I believe that you can just call the IsValidLanguageGroup Function[^] Such as:BOOL bSupported = IsValidLanguageGroup(LGRPID_INDIC,LGRPID_SUPPORTED); BOOL bInstalled = IsValidLanguageGroup(LGRPID_INDIC,LGRPID_INSTALLED);
              Best Wishes. -David Delaune

              K Offline
              K Offline
              kiranin
              wrote on last edited by
              #6

              IsValidLanguageGroup(LGRPID_SIMPLIFIED_CHINESE | LGRPID_TRADITIONAL_CHINESE, LGRPID_INSTALLED); is returning false when i tried in Windows XP Chinese, but it is returning true in English OS where East Asian language pack installed

              L 1 Reply Last reply
              0
              • K kiranin

                IsValidLanguageGroup(LGRPID_SIMPLIFIED_CHINESE | LGRPID_TRADITIONAL_CHINESE, LGRPID_INSTALLED); is returning false when i tried in Windows XP Chinese, but it is returning true in English OS where East Asian language pack installed

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                kiranin wrote:

                IsValidLanguageGroup(LGRPID_SIMPLIFIED_CHINESE | LGRPID_TRADITIONAL_CHINESE, LGRPID_INSTALLED); is returning false when i tried in Windows XP Chinese, but it is returning true in English OS where East Asian language pack installed

                #define LGRPID_TRADITIONAL_CHINESE 0x0009 // Traditional Chinese #define LGRPID_SIMPLIFIED_CHINESE 0x000a // Simplified Chinese #define LGRPID_THAI 0x000b // Thai
                0x000a | 0x0009 == 0x0B You just confirmed that the LGRPID_THAI language is not installed on the Windows XP Chinese computer. Change your code to:BOOL bSimpleInstalled = IsValidLanguageGroup(LGRPID_SIMPLIFIED_CHINESE, LGRPID_INSTALLED); BOOL bTradInstalled = IsValidLanguageGroup(LGRPID_TRADITIONAL_CHINESE, LGRPID_INSTALLED);
                Best Wishes, -David Delaune

                K 1 Reply Last reply
                0
                • L Lost User

                  kiranin wrote:

                  IsValidLanguageGroup(LGRPID_SIMPLIFIED_CHINESE | LGRPID_TRADITIONAL_CHINESE, LGRPID_INSTALLED); is returning false when i tried in Windows XP Chinese, but it is returning true in English OS where East Asian language pack installed

                  #define LGRPID_TRADITIONAL_CHINESE 0x0009 // Traditional Chinese #define LGRPID_SIMPLIFIED_CHINESE 0x000a // Simplified Chinese #define LGRPID_THAI 0x000b // Thai
                  0x000a | 0x0009 == 0x0B You just confirmed that the LGRPID_THAI language is not installed on the Windows XP Chinese computer. Change your code to:BOOL bSimpleInstalled = IsValidLanguageGroup(LGRPID_SIMPLIFIED_CHINESE, LGRPID_INSTALLED); BOOL bTradInstalled = IsValidLanguageGroup(LGRPID_TRADITIONAL_CHINESE, LGRPID_INSTALLED);
                  Best Wishes, -David Delaune

                  K Offline
                  K Offline
                  kiranin
                  wrote on last edited by
                  #8

                  Thanks David, And one more question is there a way to find the Language for Non Unicode programs which can be set through Regional and Language options?

                  L 1 Reply Last reply
                  0
                  • K kiranin

                    Thanks David, And one more question is there a way to find the Language for Non Unicode programs which can be set through Regional and Language options?

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    I believe the GetSystemDefaultLangID Function[^] will return the language for non-Unicode programs. Best Wishes, -David Delaune

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups