Jump to content

Recommended Posts

Posted

I suggest to add a new function inside WPI.

 

Inside wmi.js (from line 348):

function getKeyboardLayout(){ position="wmi.js"; whatfunc="getKeyboardLayout()";  try  {   objWMIService=GetObject("winmgmts:\\\\" + "." + "\\root\\CIMV2");   colItems=objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly);      enumItems=new Enumerator(colItems);            objItem=enumItems.item();   KeyboardLayout=objItem.Locale;     }     catch(ex)           {           }               return KeyboardLayout;}

 

Inside core.js (replace):

// %OSLANG% var LCID;  CreateLocalArray(); try {         objWMIService=GetObject("winmgmts:\\\\" + "." + "\\root\\CIMV2");          colItems=objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly);                  enumItems=new Enumerator(colItems);         objItem=enumItems.item();         LCID=objItem.Locale;          for (var x=0; x<arrOSLang.length; x++)   {   if (arrOSLang[x].LCID==LCID)   {         oslang=arrOSLang[x].TLA;         oslocale=arrOSLang[x].Locale;           break;   } } } catch(ex) {  oslang="ENU";  oslocale="English - United States"; }  // Environment variable for batch file setEnvVar("HDD",hdd,false); setEnvVar("CDDRV",cddrv,false); setEnvVar("WPIPATH",wpipath,false); setEnvVar("ROOT",root,false); setEnvVar("OSLANG",oslang,false); setEnvVar("OSLOCALE",oslocale,false);}

 

And remove inside core.js:

function DecToHex(d){ position="core.js"; whatfunc="DecToHex()"; var hD="0123456789abcdef"; var h=hD.substr(d&15,1); while(d>15) {  d>>=4;  h=hD.substr(d&15,1)+h; } return h;}

 

Inside global.js

// wmi.js var KeyboardLayout;

 

Inside global_lang.js

var lblKeyboardLayout=[];

 

Inside information.js (on line 119):

MyComputerGrid.addRow(gId++,getText(lblKeyboardLayout)+','+getKeyboardLayout()+'');

 

Inside lang_en.js

lblKeyboardLayout[lang]         = ['Keyboard Layout'];

 

Tested and works fine for me!

 

Image:

https://skydrive.live.com/?lc=4108#cid=D178EA021B182B88&id=D178EA021B182B88%211515

 

Thanks to check if it's OK!

 

Regards

 

 

 

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...