how to know the windows language?!!
-
- Enthusiast
- Posts: 237
- Joined: Tue Apr 05, 2005 11:20 pm
how to know the windows language?!!
hi i need a bulletproof method for knowing the language of the installed windows OS i already know the version thanks to pb functions but how to know the language? bullet prooof method anyone knows ?
-
- Enthusiast
- Posts: 237
- Joined: Tue Apr 05, 2005 11:20 pm
i foundt a source
; English forum: http://purebasic.myforums.net/viewtopic ... ight=greek
; Author: GPI
; Date: 03. March 2003
buuut my xp is english and my keyboard language is other howevr the source told me the KEYBOARD laongauge and not the OS !!!!!!!!!
see this is nott bullet proof
; English forum: http://purebasic.myforums.net/viewtopic ... ight=greek
; Author: GPI
; Date: 03. March 2003
buuut my xp is english and my keyboard language is other howevr the source told me the KEYBOARD laongauge and not the OS !!!!!!!!!
see this is nott bullet proof
with vbs ?
Code: Select all
Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
Wscript.Echo "Boot Device: " & objOperatingSystem.BootDevice
Wscript.Echo "Build Number: " & objOperatingSystem.BuildNumber
Wscript.Echo "Build Type: " & objOperatingSystem.BuildType
Wscript.Echo "Caption: " & objOperatingSystem.Caption
Wscript.Echo "Code Set: " & objOperatingSystem.CodeSet
Wscript.Echo "Country Code: " & objOperatingSystem.CountryCode
Wscript.Echo "Debug: " & objOperatingSystem.Debug
Wscript.Echo "Encryption Level: " & objOperatingSystem.EncryptionLevel
dtmConvertedDate.Value = objOperatingSystem.InstallDate
dtmInstallDate = dtmConvertedDate.GetVarDate
Wscript.Echo "Install Date: " & dtmInstallDate
Wscript.Echo "Licensed Users: " & _
objOperatingSystem.NumberOfLicensedUsers
Wscript.Echo "Organization: " & objOperatingSystem.Organization
Wscript.Echo "OS Language: " & objOperatingSystem.OSLanguage
Wscript.Echo "OS Product Suite: " & objOperatingSystem.OSProductSuite
Wscript.Echo "OS Type: " & objOperatingSystem.OSType
Wscript.Echo "Primary: " & objOperatingSystem.Primary
Wscript.Echo "Registered User: " & objOperatingSystem.RegisteredUser
Wscript.Echo "Serial Number: " & objOperatingSystem.SerialNumber
Wscript.Echo "Version: " & objOperatingSystem.Version
Next
Or with DroopyLib and the WMI Function (Author : DataMiner )
You have all code of OSLanguage here : http://msdn.microsoft.com/library/defau ... system.asp
Code: Select all
MessageRequester("WMI",WMI("Select * from Win32_OperatingSystem,OSLanguage"))
-
- Enthusiast
- Posts: 237
- Joined: Tue Apr 05, 2005 11:20 pm
thanks! ill check it outt
does anione know how to use the PureZIP_W library??
ZLIBzipOpenNewFileInZip3(zipFile.l, *FileName, *zip_fileinfo, *extrafield_local, size_extrafield_local.l, *extrafield_global, size_extrafield_global.l, *comment, method.l, level.l, raw.l, windowBits.l, memLevel.l, strategy.l, *password, crcForCrypting.l)
i tried using ZLIBzipOpenNewFileInZip buuuut the zip is only saved with the file names pathts and all but no file data i mean they are 0 bytes files what is the probelm ???
does anione know how to use the PureZIP_W library??
ZLIBzipOpenNewFileInZip3(zipFile.l, *FileName, *zip_fileinfo, *extrafield_local, size_extrafield_local.l, *extrafield_global, size_extrafield_global.l, *comment, method.l, level.l, raw.l, windowBits.l, memLevel.l, strategy.l, *password, crcForCrypting.l)
i tried using ZLIBzipOpenNewFileInZip buuuut the zip is only saved with the file names pathts and all but no file data i mean they are 0 bytes files what is the probelm ???
-
- User
- Posts: 78
- Joined: Sun Apr 24, 2005 3:22 am
-
- Enthusiast
- Posts: 237
- Joined: Tue Apr 05, 2005 11:20 pm
-
- Enthusiast
- Posts: 237
- Joined: Tue Apr 05, 2005 11:20 pm
Sure you can use that, but you could also use this: (not tested, also no guarantee it works on PB as I'm at friend and he doesn't have PB
)
Please tell me if that code even works, I think it should work.,.,,
- Josku_X.

Code: Select all
UserLanguage=GetUserDefaultUILanguage_()
SystemLanguage=GetSystemDefaultUILanguage_()
MessageRequester("Info", "Your User Language is: "+UserLanguage, #MB_ICONINFORMATION)
MessageRequester("Info", "Your System Language is: "+SystemLanguage, #MB_ICONINFORMATION)
- Josku_X.
EDIT: I have now seen many Visual Basic snippets using this function and it seems, it returns an integer value, I'll update this code when I'm home. So I'll add language enumeration...
I whipped this one up and tested it on WinXP only with PB 3.94.
Code: Select all
;--> Get OS version language
;--> Author: Sparkie
;--> Date: 11/07/2005
Procedure.s GetOSLanguage()
result$ = "Error: Unable to determine OS Language"
If OpenLibrary(0, "version.dll")
sysDir$ = Space(#MAX_PATH + 1)
osLang$ = Space(100)
GetSystemDirectory_(@sysDir$, #MAX_PATH + 1)
fviSize = CallFunction(0, "GetFileVersionInfoSizeA", sysDir$ + "/User.exe", @zeroVar)
If fviSize > 0
*fviBuffer = AllocateMemory(fviSize)
If CallFunction(0, "GetFileVersionInfoA", sysDir$ + "/User.exe", 0, fviSize, *fviBuffer) <> 0
If CallFunction(0, "VerQueryValueA", *fviBuffer, "\\VarFileInfo\\Translation", @pBuffer, @valLen) <> 0
If CallFunction(0, "VerLanguageNameA", PeekW(pBuffer), @osLang$, 100) <> 0
result$ = osLang$
EndIf
EndIf
EndIf
FreeMemory(*fviBuffer)
EndIf
CloseLibrary(0)
Else
result$ = "Error: Unable to open version.dll"
EndIf
ProcedureReturn result$
EndProcedure
MessageRequester("OS Language", GetOSLanguage())
End
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
-
- Enthusiast
- Posts: 767
- Joined: Sat Jan 24, 2004 6:56 pm
On my XP-Pro box, this code reports the correct language(s)...Sparkie wrote:I whipped this one up and tested it on WinXP only with PB 3.94.Code: Select all
;--> Get OS version language ;--> Author: Sparkie ;--> Date: 11/07/2005 Procedure.s GetOSLanguage() result$ = "Error: Unable to determine OS Language" If OpenLibrary(0, "version.dll") sysDir$ = Space(#MAX_PATH + 1) osLang$ = Space(100) GetSystemDirectory_(@sysDir$, #MAX_PATH + 1) fviSize = CallFunction(0, "GetFileVersionInfoSizeA", sysDir$ + "/User.exe", @zeroVar) If fviSize > 0 *fviBuffer = AllocateMemory(fviSize) If CallFunction(0, "GetFileVersionInfoA", sysDir$ + "/User.exe", 0, fviSize, *fviBuffer) <> 0 If CallFunction(0, "VerQueryValueA", *fviBuffer, "\\VarFileInfo\\Translation", @pBuffer, @valLen) <> 0 If CallFunction(0, "VerLanguageNameA", PeekW(pBuffer), @osLang$, 100) <> 0 result$ = osLang$ EndIf EndIf EndIf FreeMemory(*fviBuffer) EndIf CloseLibrary(0) Else result$ = "Error: Unable to open version.dll" EndIf ProcedureReturn result$ EndProcedure MessageRequester("OS Language", GetOSLanguage()) End
Thanks