如何取得WINDOWS版本? 要取得版本号, 而且要知道是英文版,简体中文还是繁体正文?(50分)

  • 主题发起人 主题发起人 lixuejian
  • 开始时间 开始时间
L

lixuejian

Unregistered / Unconfirmed
GUEST, unregistred user!
如何取得WINDOWS版本? 要取得版本号, 而且要知道是英文版,简体中文还是繁体正文?<br>校验正确后马上发分!
 
shellabout(self.handle,'[xx系统 1.0]','版权所有(C)2002-2003'+<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#13+#10+'',(application.icon).handle);<br>怎么判断是不是简体中文的偶也不知道,不过一看系统就知道了吧,呵呵
 
var<br>&nbsp; vo:TOSVERSIONINFO;<br>begin<br>&nbsp; &nbsp; GetVersionEX(vo);<br>end;<br><br>type<br>&nbsp; POSVersionInfoA = ^TOSVersionInfoA;<br>&nbsp; POSVersionInfoW = ^TOSVersionInfoW;<br>&nbsp; POSVersionInfo = POSVersionInfoA;<br>&nbsp; _OSVERSIONINFOA = record<br>&nbsp; &nbsp; dwOSVersionInfoSize: DWORD;<br>&nbsp; &nbsp; dwMajorVersion: DWORD;<br>&nbsp; &nbsp; dwMinorVersion: DWORD;<br>&nbsp; &nbsp; dwBuildNumber: DWORD;<br>&nbsp; &nbsp; dwPlatformId: DWORD;<br>&nbsp; &nbsp; szCSDVersion: array[0..127] of AnsiChar; { Maintenance string for PSS usage }<br>&nbsp; end;<br>&nbsp; {$EXTERNALSYM _OSVERSIONINFOA}<br>&nbsp; _OSVERSIONINFOW = record<br>&nbsp; &nbsp; dwOSVersionInfoSize: DWORD;<br>&nbsp; &nbsp; dwMajorVersion: DWORD;<br>&nbsp; &nbsp; dwMinorVersion: DWORD;<br>&nbsp; &nbsp; dwBuildNumber: DWORD;<br>&nbsp; &nbsp; dwPlatformId: DWORD;<br>&nbsp; &nbsp; szCSDVersion: array[0..127] of WideChar; { Maintenance string for PSS usage }<br>&nbsp; end;<br>&nbsp; {$EXTERNALSYM _OSVERSIONINFOW}<br>&nbsp; _OSVERSIONINFO = _OSVERSIONINFOA;<br>&nbsp; TOSVersionInfoA = _OSVERSIONINFOA;<br>&nbsp; TOSVersionInfoW = _OSVERSIONINFOW;<br>&nbsp; TOSVersionInfo = TOSVersionInfoA;<br>&nbsp; OSVERSIONINFOA = _OSVERSIONINFOA;<br>&nbsp; {$EXTERNALSYM OSVERSIONINFOA}<br>&nbsp; {$EXTERNALSYM OSVERSIONINFO}<br>&nbsp; OSVERSIONINFOW = _OSVERSIONINFOW;<br>&nbsp; {$EXTERNALSYM OSVERSIONINFOW}<br>&nbsp; {$EXTERNALSYM OSVERSIONINFO}<br>&nbsp; OSVERSIONINFO = OSVERSIONINFOA;<br><br>{ dwPlatformId defines }<br>const<br>&nbsp; VER_PLATFORM_WIN32s = 0;<br>&nbsp; {$EXTERNALSYM VER_PLATFORM_WIN32s}<br>&nbsp; VER_PLATFORM_WIN32_WINDOWS = 1;<br>&nbsp; {$EXTERNALSYM VER_PLATFORM_WIN32_WINDOWS}<br>&nbsp; VER_PLATFORM_WIN32_NT = 2;<br>&nbsp; {$EXTERNALSYM VER_PLATFORM_WIN32_NT}<br><br>function GetVersionEx(var lpVersionInformation: TOSVersionInfo): BOOL; stdcall;<br>{$EXTERNALSYM GetVersionEx}<br>function GetVersionExA(var lpVersionInformation: TOSVersionInfo): BOOL; stdcall;<br>{$EXTERNALSYM GetVersionExA}<br>function GetVersionExW(var lpVersionInformation: TOSVersionInfo): BOOL; stdcall;<br>{$EXTERNALSYM GetVersionExW}<br><br>{ DOS and OS/2 Compatible Error Code definitions returned by the Win32 Base<br>&nbsp; API functions. }<br><br><br>{ Translated from WINERROR.H }<br>{ Error code definitions for the Win32 API functions }<br><br>(*<br>&nbsp; Values are 32 bit values layed out as follows:<br>&nbsp; &nbsp;3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1<br>&nbsp; &nbsp;1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0<br>&nbsp; +---+-+-+-----------------------+-------------------------------+<br>&nbsp; |Sev|C|R| &nbsp; &nbsp; Facility &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Code &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; +---+-+-+-----------------------+-------------------------------+<br><br>&nbsp; where<br>&nbsp; &nbsp; &nbsp; Sev - is the severity code<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 00 - Success<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 01 - Informational<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10 - Warning<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 11 - Error<br><br>&nbsp; &nbsp; &nbsp; C - is the Customer code flag<br>&nbsp; &nbsp; &nbsp; R - is a reserved bit<br>&nbsp; &nbsp; &nbsp; Facility - is the facility code<br>&nbsp; &nbsp; &nbsp; Code - is the facility's status code<br>*)<br><br>{ Define the facility codes }<br><br>const<br>&nbsp; FACILITY_WINDOWS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 8;<br>&nbsp; {$EXTERNALSYM FACILITY_WINDOWS}<br>&nbsp; FACILITY_STORAGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 3;<br>&nbsp; {$EXTERNALSYM FACILITY_STORAGE}<br>&nbsp; FACILITY_RPC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 1;<br>&nbsp; {$EXTERNALSYM FACILITY_RPC}<br>&nbsp; FACILITY_SSPI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 9;<br>&nbsp; {$EXTERNALSYM FACILITY_SSPI}<br>&nbsp; FACILITY_WIN32 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 7;<br>&nbsp; {$EXTERNALSYM FACILITY_WIN32}<br>&nbsp; FACILITY_CONTROL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 10;<br>&nbsp; {$EXTERNALSYM FACILITY_CONTROL}<br>&nbsp; FACILITY_NULL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 0;<br>&nbsp; {$EXTERNALSYM FACILITY_NULL}<br>&nbsp; FACILITY_INTERNET &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 12;<br>&nbsp; {$EXTERNALSYM FACILITY_INTERNET}<br>&nbsp; FACILITY_ITF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 4;<br>&nbsp; {$EXTERNALSYM FACILITY_ITF}<br>&nbsp; FACILITY_DISPATCH &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 2;<br>&nbsp; {$EXTERNALSYM FACILITY_DISPATCH}<br>&nbsp; FACILITY_CERT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 11;<br>&nbsp; {$EXTERNALSYM FACILITY_CERT}<br><br><br>{ Define the severity codes }<br><br>&nbsp; { The operation completed successfully. }<br>&nbsp; ERROR_SUCCESS = 0;<br>&nbsp; {$EXTERNALSYM ERROR_SUCCESS}<br>&nbsp; NO_ERROR = 0; &nbsp; { dderror }<br>&nbsp; {$EXTERNALSYM NO_ERROR}<br><br>&nbsp; { Incorrect function. }<br>&nbsp; ERROR_INVALID_FUNCTION = 1; &nbsp; { dderror }<br>&nbsp; {$EXTERNALSYM ERROR_INVALID_FUNCTION}<br><br>&nbsp; { The system cannot find the file specified. }<br>&nbsp; ERROR_FILE_NOT_FOUND = 2;<br>&nbsp; {$EXTERNALSYM ERROR_FILE_NOT_FOUND}<br><br>&nbsp; { The system cannot find the path specified. }<br>&nbsp; ERROR_PATH_NOT_FOUND = 3;<br>&nbsp; {$EXTERNALSYM ERROR_PATH_NOT_FOUND}<br><br>&nbsp; { The system cannot open the file. }<br>&nbsp; ERROR_TOO_MANY_OPEN_FILES = 4;<br>&nbsp; {$EXTERNALSYM ERROR_TOO_MANY_OPEN_FILES}<br><br>&nbsp; { Access is denied. }<br>&nbsp; ERROR_ACCESS_DENIED = 5;<br>&nbsp; {$EXTERNALSYM ERROR_ACCESS_DENIED}<br><br>&nbsp; { The handle is invalid. }<br>&nbsp; ERROR_INVALID_HANDLE = 6;<br>&nbsp; {$EXTERNALSYM ERROR_INVALID_HANDLE}<br><br>&nbsp; { The storage control blocks were destroyed. }<br>&nbsp; ERROR_ARENA_TRASHED = 7;<br>&nbsp; {$EXTERNALSYM ERROR_ARENA_TRASHED}<br><br>&nbsp; { Not enough storage is available to process this command. }<br>&nbsp; ERROR_NOT_ENOUGH_MEMORY = 8; &nbsp; { dderror }<br>&nbsp; {$EXTERNALSYM ERROR_NOT_ENOUGH_MEMORY}<br><br>&nbsp; { The storage control block address is invalid. }<br>&nbsp; ERROR_INVALID_BLOCK = 9;<br>&nbsp; {$EXTERNALSYM ERROR_INVALID_BLOCK}<br><br>&nbsp; { The environment is incorrect. }<br>&nbsp; ERROR_BAD_ENVIRONMENT = 10;<br>&nbsp; {$EXTERNALSYM ERROR_BAD_ENVIRONMENT}<br><br>&nbsp; { An attempt was made to load a program with an incorrect format. }<br>&nbsp; ERROR_BAD_FORMAT = 11;<br>&nbsp; {$EXTERNALSYM ERROR_BAD_FORMAT}<br><br>&nbsp; { The access code is invalid. }<br>&nbsp; ERROR_INVALID_ACCESS = 12;<br>&nbsp; {$EXTERNALSYM ERROR_INVALID_ACCESS}<br><br>&nbsp; { The data is invalid. }<br>&nbsp; ERROR_INVALID_DATA = 13;<br>&nbsp; {$EXTERNALSYM ERROR_INVALID_DATA}<br><br>&nbsp; { Not enough storage is available to complete this operation. }<br>&nbsp; ERROR_OUTOFMEMORY = 14;<br>&nbsp; {$EXTERNALSYM ERROR_OUTOFMEMORY}<br><br>&nbsp; { The system cannot find the drive specified. }<br>&nbsp; ERROR_INVALID_DRIVE = 15;<br>&nbsp; {$EXTERNALSYM ERROR_INVALID_DRIVE}<br><br>&nbsp; { The directory cannot be removed. }<br>&nbsp; ERROR_CURRENT_DIRECTORY = $10;<br>&nbsp; {$EXTERNALSYM ERROR_CURRENT_DIRECTORY}<br><br>&nbsp; { The system cannot move the file }<br>&nbsp; { to a different disk drive. }<br>&nbsp; ERROR_NOT_SAME_DEVICE = 17;<br>&nbsp; {$EXTERNALSYM ERROR_NOT_SAME_DEVICE}<br><br>&nbsp; { There are no more files. }<br>&nbsp; ERROR_NO_MORE_FILES = 18;<br>&nbsp; {$EXTERNALSYM ERROR_NO_MORE_FILES}<br><br>&nbsp; { The media is write protected. }<br>&nbsp; ERROR_WRITE_PROTECT = 19;<br>&nbsp; {$EXTERNALSYM ERROR_WRITE_PROTECT}<br><br>&nbsp; { The system cannot find the device specified. }<br>&nbsp; ERROR_BAD_UNIT = 20;<br>&nbsp; {$EXTERNALSYM ERROR_BAD_UNIT}<br><br>&nbsp; { The device is not ready. }<br>&nbsp; ERROR_NOT_READY = 21;<br>&nbsp; {$EXTERNALSYM ERROR_NOT_READY}<br><br>&nbsp; { The device does not recognize the command. }<br>&nbsp; ERROR_BAD_COMMAND = 22;<br>&nbsp; {$EXTERNALSYM ERROR_BAD_COMMAND}<br><br>&nbsp; { Data error (cyclic redundancy check) }<br>&nbsp; ERROR_CRC = 23;<br>&nbsp; {$EXTERNALSYM ERROR_CRC}<br><br>&nbsp; { The program issued a command but the command length is incorrect. }<br>&nbsp; ERROR_BAD_LENGTH = 24;<br>&nbsp; {$EXTERNALSYM ERROR_BAD_LENGTH}<br><br>&nbsp; { The drive cannot locate a specific area or track on the disk. }<br>&nbsp; ERROR_SEEK = 25;<br>&nbsp; {$EXTERNALSYM ERROR_SEEK}<br><br>&nbsp; { The specified disk or diskette cannot be accessed. }<br>&nbsp; ERROR_NOT_DOS_DISK = 26;<br>&nbsp; {$EXTERNALSYM ERROR_NOT_DOS_DISK}<br><br>&nbsp; { The drive cannot find the sector requested. }<br>&nbsp; ERROR_SECTOR_NOT_FOUND = 27;<br>&nbsp; {$EXTERNALSYM ERROR_SECTOR_NOT_FOUND}<br><br>&nbsp; { The printer is out of paper. }<br>&nbsp; ERROR_OUT_OF_PAPER = 28;<br>&nbsp; {$EXTERNALSYM ERROR_OUT_OF_PAPER}<br><br>&nbsp; { The system cannot write to the specified device. }<br>&nbsp; ERROR_WRITE_FAULT = 29;<br>&nbsp; {$EXTERNALSYM ERROR_WRITE_FAULT}<br><br>&nbsp; { The system cannot read from the specified device. }<br>&nbsp; ERROR_READ_FAULT = 30;<br>&nbsp; {$EXTERNALSYM ERROR_READ_FAULT}<br><br>&nbsp; { A device attached to the system is not functioning. }<br>&nbsp; ERROR_GEN_FAILURE = 31;<br>&nbsp; {$EXTERNALSYM ERROR_GEN_FAILURE}<br><br>&nbsp; { The process cannot access the file because it is being used by another process. }<br>&nbsp; ERROR_SHARING_VIOLATION = $20;<br>&nbsp; {$EXTERNALSYM ERROR_SHARING_VIOLATION}<br><br>&nbsp; { The process cannot access the file because }<br>&nbsp; { another process has locked a portion of the file. }<br>&nbsp; ERROR_LOCK_VIOLATION = 33;<br>&nbsp; {$EXTERNALSYM ERROR_LOCK_VIOLATION}<br><br>&nbsp; { The wrong diskette is in the drive. Insert %2 (Volume Serial Number: %3) }<br>&nbsp; { into drive %1. }<br>&nbsp; ERROR_WRONG_DISK = 34;<br>&nbsp; {$EXTERNALSYM ERROR_WRONG_DISK}<br><br>&nbsp; { Too many files opened for sharing. }<br>&nbsp; ERROR_SHARING_BUFFER_EXCEEDED = 36;<br>&nbsp; {$EXTERNALSYM ERROR_SHARING_BUFFER_EXCEEDED}<br><br>&nbsp; { Reached end of file. }<br>&nbsp; ERROR_HANDLE_EOF = 38;<br>&nbsp; {$EXTERNALSYM ERROR_HANDLE_EOF}<br><br>&nbsp; { The disk is full. }<br>&nbsp; ERROR_HANDLE_DISK_FULL = 39;<br>&nbsp; {$EXTERNALSYM ERROR_HANDLE_DISK_FULL}<br><br>&nbsp; { The network request is not supported. }<br>&nbsp; ERROR_NOT_SUPPORTED = 50;<br>&nbsp; {$EXTERNALSYM ERROR_NOT_SUPPORTED}<br><br>&nbsp; { The remote computer is not available. }<br>&nbsp; ERROR_REM_NOT_LIST = 51;<br>&nbsp; {$EXTERNALSYM ERROR_REM_NOT_LIST}<br><br>&nbsp; { A duplicate name exists on the network. }<br>&nbsp; ERROR_DUP_NAME = 52;<br>&nbsp; {$EXTERNALSYM ERROR_DUP_NAME}<br><br>&nbsp; { The network path was not found. }<br>&nbsp; ERROR_BAD_NETPATH = 53;<br>&nbsp; {$EXTERNALSYM ERROR_BAD_NETPATH}<br><br>&nbsp; { The network is busy. }<br>&nbsp; ERROR_NETWORK_BUSY = 54;<br>&nbsp; {$EXTERNALSYM ERROR_NETWORK_BUSY}<br><br>&nbsp; { The specified network resource or device is no longer }<br>&nbsp; { available. }<br>&nbsp; ERROR_DEV_NOT_EXIST = 55; &nbsp; { dderror }<br>&nbsp; {$EXTERNALSYM ERROR_DEV_NOT_EXIST}<br><br>&nbsp; { The network BIOS command limit has been reached. }<br>&nbsp; ERROR_TOO_MANY_CMDS = 56;<br>&nbsp; {$EXTERNALSYM ERROR_TOO_MANY_CMDS}<br><br>&nbsp; { A network adapter hardware error occurred. }<br>&nbsp; ERROR_ADAP_HDW_ERR = 57;<br>&nbsp; {$EXTERNALSYM ERROR_ADAP_HDW_ERR}<br><br>&nbsp; { The specified server cannot perform the requested }<br>&nbsp; { operation. }<br>&nbsp; ERROR_BAD_NET_RESP = 58;<br>&nbsp; {$EXTERNALSYM ERROR_BAD_NET_RESP}<br><br>&nbsp; { An unexpected network error occurred. }<br>&nbsp; ERROR_UNEXP_NET_ERR = 59;<br>&nbsp; {$EXTERNALSYM ERROR_UNEXP_NET_ERR}<br><br>&nbsp; { The remote adapter is not compatible. }<br>&nbsp; ERROR_BAD_REM_ADAP = 60;<br>&nbsp; {$EXTERNALSYM ERROR_BAD_REM_ADAP}<br><br>&nbsp; { The printer queue is full. }<br>&nbsp; ERROR_PRINTQ_FULL = 61;<br>&nbsp; {$EXTERNALSYM ERROR_PRINTQ_FULL}<br><br>&nbsp; { Space to store the file waiting to be printed is }<br>&nbsp; { not available on the server. }<br>&nbsp; ERROR_NO_SPOOL_SPACE = 62;<br>&nbsp; {$EXTERNALSYM ERROR_NO_SPOOL_SPACE}<br><br>&nbsp; { Your file waiting to be printed was deleted. }<br>&nbsp; ERROR_PRINT_CANCELLED = 63;<br>&nbsp; {$EXTERNALSYM ERROR_PRINT_CANCELLED}<br><br>&nbsp; { The specified network name is no longer available. }<br>&nbsp; ERROR_NETNAME_DELETED = $40;<br>&nbsp; {$EXTERNALSYM ERROR_NETNAME_DELETED}<br><br>&nbsp; { Network access is denied. }<br>&nbsp; ERROR_NETWORK_ACCESS_DENIED = 65;<br>&nbsp; {$EXTERNALSYM ERROR_NETWORK_ACCESS_DENIED}<br><br>&nbsp; { The network resource type is not correct. }<br>&nbsp; ERROR_BAD_DEV_TYPE = 66;<br>&nbsp; {$EXTERNALSYM ERROR_BAD_DEV_TYPE}<br><br>&nbsp; { The network name cannot be found. }<br>&nbsp; ERROR_BAD_NET_NAME = 67;<br>&nbsp; {$EXTERNALSYM ERROR_BAD_NET_NAME}<br><br>&nbsp; { The name limit for the local computer network }<br>&nbsp; { adapter card was exceeded. }<br>&nbsp; ERROR_TOO_MANY_NAMES = 68;<br>&nbsp; {$EXTERNALSYM ERROR_TOO_MANY_NAMES}<br><br><br><br><br>
 
要知道是英文版,简体中文还是繁体正文,我的方法比较简单:<br>&nbsp; Const<br>&nbsp; &nbsp; &nbsp;ENGLISH = (SUBLANG_ENGLISH_US shl 10) or LANG_ENGLISH;<br>&nbsp; &nbsp; &nbsp;CHINESE = (SUBLANG_CHINESE_SIMPLIFIED shl 10) or LANG_CHINESE;<br>&nbsp; &nbsp; &nbsp;TCHINESE =(SUBLANG_CHINESE_TRADITIONAL SHL 10) OR LANG_CHINESE;<br>&nbsp; Begin <br>&nbsp; &nbsp;If SysLocale.DefaultLCID=CHINESE then<br>&nbsp; &nbsp; &nbsp;ShowMessage('中文简体')<br>&nbsp; Else<br>&nbsp; &nbsp;If SysLocale.DefaultLCID=TCHINESE then<br>&nbsp; &nbsp; &nbsp;ShowMessage('中文繁体')<br>&nbsp; Else<br>&nbsp; &nbsp;If SysLocale.DefaultLCID=English then<br>&nbsp; &nbsp; ShowMessage('英文版');<br>&nbsp;End;<br><br>
 
多人接受答案了。
 
后退
顶部