tags:

views:

360

answers:

2

How to check, from C#, are files for complex script and rtl languages (Regional and Language settings) installed?

Edit: Or is there another way of checking whether right to left text will display correctly in my form?

Edit for better explanation (I hope :)) I'm creating an application that will use Arabic letters (free dictionary). So, I want to check are: "Files for complex script and right-to-left languages(Including Thai)" (CheckBox in "Regional and Language Options" in Language Tab) installed (Is CheckBox checked.). If they are not installed, Arabic words will not display correctly,and I want to warn user if that is the case.

Thanks

+1  A: 

I'm not sure if this will get you all the way there but, you can query WMI. If you are using .Net, check out the System.Management namespace. You will be interested in...

Namespace: root\cimv2 Class: Win32_OperatingSystem Properties: MUILanguages and/or Locale

Brent Rockwood
A: 

Hi Brent Rockwood, Thank you for your info. I queried WMI for Win32_OperatingSystem Properties. It returns Win32_OperatingSystem Class with all fields and properties except MUILanguages :(

...
  uint32 MaxNumberOfProcesses;
  uint64 MaxProcessMemorySize;
  string MUILanguages[]; //I don't see this field, and all others I see
  string Name;
  uint32 NumberOfLicensedUsers;
...

Any help? I use WinXP SP2 and VS2005

Code I used refereence: System.Management;

string ConfigNamespace = @"\\.\root\cimv2";
string query = "select * from Win32_OperatingSystem";

ManagementObjectSearcher searcher = 
  new ManagementObjectSearcher(ConfigNamespace, query);

ManagementObjectCollection collection = searcher.Get();

foreach (ManagementObject item in collection)
{
  //PropertyData pd = item.Properties["MUILanguages"];

  foreach (PropertyData data in item.Properties)
  {

  }
}
Afree