nesco писал(а):
Assasin, подумай еще над функционалом, возможно, удасться выдавить чегоАга, уже нашел, TOSVersionInfo содержит все необходимое для сообщения эквивалентному olDjeka:
Microsoft Windows XP Professional версия 2002 Service Pack 3
[Версия 5.1.2600]
Все что выделено жирным шрифтом, я нашел, а вот Professional и версия 2002 где взять, не найду
------------ Дoбавленo в 14.50:
nesco, вот такая вот картина, как убрать лишние ~100 символов понятия не имею...
Add(MainForm,2953706,252,168)
{
Visible=1
link(onCreate,5660744:doGetOSVersion,[])
}
Add(InlineCode,5660744,308,182)
{
WorkPoints=#14:doGetOSVersion|
EventPoints=#5:onGet|
VarPoints=#13:OSVersionName|14:OSMajorVersion|14:OSMinorVersion|13:OSBuildNumber|12:OSPlatformID|8:OSCSDVer|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|29:uses kol,Share,Debug,Windows;|0:|4:type|84: TWinVersion = (wvUnknown,wv95,wv98,wvME,wvNT3,wvNT4,wvW2K,wvXP,wv2003,wvVista,wv7);|0:|28: THiAsmClass = class(TDebug)|10: private|23: ver,CSDVer:string;|37: MajVer,MinVer,BuildN,PlID:DWORD;|9: public|21: onget:THI_Event;|5: |59: procedure doGetOSVersion(var _Data:TData; Index:word);|58: procedure OSVersionName(var _Data:TData; Index:word);|59: procedure OSMajorVersion(var _Data:TData; Index:word);|59: procedure OSMinorVersion(var _Data:TData; Index:word);|58: procedure OSBuildNumber(var _Data:TData; Index:word);|57: procedure OSPlatformID(var _Data:TData; Index:word);|53: procedure OSCSDVer(var _Data:TData; Index:word);|5: |43: function DetectWinVersion:TWinVersion;|41: function DetectWinVersionStr:string;|5: end;|0:|14:implementation|0:|50:function THiAsmClass.DetectWinVersion:TWinVersion;|33:var OSVersionInfo:TOSVersionInfo;|14: i:integer;|5:begin|22: Result := wvUnknown;|62: OSVersionInfo.dwOSVersionInfoSize := sizeof(TOSVersionInfo);|37: if GetVersionEx(OSVersionInfo) then|8: begin|26: SetLength(CSDVer,128);|70: for i := 0 to 127 do CSDVer[i+1] := OSVersionInfo.szCSDVersion[i];|43: MajVer := OSVersionInfo.DwMajorVersion;|43: MinVer := OSVersionInfo.DwMinorVersion;|39: PlID := OSVersionInfo.dwPlatformId;|42: BuildN := OSVersionInfo.dwBuildNumber;|18: case MajVer of|54: 3: Result := wvNT3; // Windows NT 3|23: 4: case MinVer of|45: 0: if PlID = VER_PLATFORM_WIN32_NT|54: then Result := wvNT4 // Windows NT 4|52: else Result := wv95; // Windows 95|52: 10: Result := wv98; // Windows 98|52: 90: Result := wvME; // Windows ME|17: end;|23: 5: case MinVer of|54: 0: Result := wvW2K; // Windows 2000|52: 1: Result := wvXP; // Windows XP|54: 2: Result := wv2003; // Windows 2003|13: end;|23: 6: case MinVer of|55: 0: Result := wvVista; // Windows Vista|51: 1: Result := wv7; // Windows 7|13: end;|7: end;|6: end;|4:end;|0:|48:function THiAsmClass.DetectWinVersionStr:string;|6:const |44: VersStr : array[TWinVersion] of string = (|14: 'Unknown',|9: '95',|9: '98',|9: 'ME',|11: 'NT 3',|11: 'NT 4',|11: '2000',|9: 'XP',|11: '2003',|12: 'Vista',|7: '7'|4: );|5:begin|38: Result := VersStr[DetectWinVersion];|4:end;|0:|37:procedure THiAsmClass.doGetOSVersion;|5:begin|29: ver := DetectWinVersionStr;|32: _hi_CreateEvent(_Data,@onGet);|4:end;|0:|36:procedure THiAsmClass.OSVersionName;|5:begin|22: dtString(_Data,ver);|4:end;|0:|37:procedure THiAsmClass.OSMajorVersion;|5:begin|26: dtInteger(_data,MajVer);|4:end;|0:|37:procedure THiAsmClass.OSMinorVersion;|5:begin|26: dtInteger(_data,MinVer);|4:end;|0:|36:procedure THiAsmClass.OSBuildNumber;|5:begin|26: dtInteger(_Data,BuildN);|4:end;|0:|35:procedure THiAsmClass.OSPlatformID;|5:begin|24: dtInteger(_Data,PlID);|4:end;|0:|31:procedure THiAsmClass.OSCSDVer;|5:begin|25: dtString(_Data,CSDVer);|4:end;|0:|4:end.|
link(onGet,6539533:doString,[(358,188)(358,212)(296,212)(296,237)])
}
Add(FormatStr,6539533,308,231)
{
DataCount=6
Mask="Microsoft Windows %1 %6, platform ID %5\r\n[version %2.%3.%4]"
link(onFString,7929789:doMessage,[])
link(Str1,5660744:OSVersionName,[])
link(Str2,5660744:OSMajorVersion,[])
link(Str3,5660744:OSMinorVersion,[])
link(Str4,5660744:OSBuildNumber,[])
link(Str5,5660744:OSPlatformID,[])
link(Str6,5660744:OSCSDVer,[])
}
Add(Message,7929789,371,231)
{
link(onMessage,2953706:doClose,[(408,237)(408,276)(242,276)(242,195)])
}