Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: OS language
I was looking up a few Win32 API's functions and then found this article
HOWTO: Determine Default Language ID of Windows 95 or WinNT http://support.microsoft.com/support/kb/articles/Q181/6/04.ASPI then made this code to see what I would get however it returns really nothing ( I think its the way I did the calls) I talked to Microsoft directly on how to get the OS language and they suggested doing the type of calls but rewrite my code using Windows Scripting Host!!! (Now I don't want that to happen and nor does your company)
Thanks again
File =strcat(DirWindows(1),"user32.dll") xx=FileVerInfo(File,"","") Message("FileVerInfo",xx)The hard way...
DllName =strcat(DirWindows(1),"Version.dll") File =strcat(DirWindows(1),"user32.dll") ; GetFileVersionInfoSizeA -- Get the size of the buffer for GetFileVersionInfoA bb=binaryalloc(20) Buffsize = DllCall(DllName, long:"GetFileVersionInfoSizeA", lpstr:File,lpbinary:bb) BinaryFree(bb) ;pause("Buffsize",buffsize") ; GetFileVersionInfoA -- Get all the version information on the file verinfobuff=binaryalloc(Buffsize) BinaryEODSet(verinfobuff, Buffsize) FileInfo = DllCall(DllName, long:"GetFileVersionInfoA",lpstr:File, long:0, long:buffsize, lpbinary:verinfobuff ) BinaryWrite(verinfobuff,"c:\incoming\aaa.dat") ; VerQueryValueA -- Find the Form information and hope its the language returned Form ="\VarFileInfo\Translation" dummybuff=BinaryAlloc(4) pointerbuf=BinaryAlloc(4) BinaryEODSet(pointerbuf,4) LangInfo = DllCall(DllName, long:"VerQueryValueA",lpbinary:verinfobuff, lpstr:Form, lpbinary:pointerbuf, lpbinary:dummybuff) ;BinaryEODSet(MakeBuff4, LangInfo) addr=BinaryPeek4(pointerbuf,0) char2=IntControl(32,addr,"BYTE",0,0) char1=IntControl(32,addr+1,"BYTE",0,0) char4=IntControl(32,addr+2,"BYTE",0,0) char3=IntControl(32,addr+3,"BYTE",0,0) BinaryFree(pointerbuf) BinaryFree(dummybuff) BinaryFree(verinfobuff) if char1<0 then char1=char1+256 if char2<0 then char2=char2+256 if char3<0 then char3=char3+256 if char4<0 then char4=char4+256 num=(char1 << 24) | (char2 << 16) | (char3 << 8 ) | char4 AddExtender("wilx34I.dll") hexnum=xBaseConvert(num,10,16) hexnum=strfixleft(hexnum,0,8) Message("The hard way",hexnum) exit
Article ID: W14466
Filename: OS Language.txt
File Created: 2001:03:01:14:34:52
Last Updated: 2001:03:01:14:34:52