{"id":756,"date":"2008-05-25T22:23:09","date_gmt":"2008-05-25T22:23:09","guid":{"rendered":"http:\/\/6teen.ru\/?p=486"},"modified":"2008-05-25T22:23:09","modified_gmt":"2008-05-25T22:23:09","slug":"6589","status":"publish","type":"post","link":"http:\/\/pblog.ru\/lab\/?p=756","title":{"rendered":"\u041a\u0430\u043a \u0443\u0437\u043d\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b"},"content":{"rendered":"<p>\u041a\u0430\u043a \u0443\u0437\u043d\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<br \/>\n<!--more--><\/p>\n<pre class=\"alt2\" style=\"margin:0px; padding:6px; border:1px inset; width:580px; height:320px; overflow:auto\"><div>\u041a\u0430\u043a \u0443\u0437\u043d\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b\n\nfunction GetFileVersion(const FileName: TFileName; var Major, Minor,\nRelease, Build: Integer): Boolean;\nvar\nInfoSize, Wnd: DWORD;\nVerBuf: Pointer;\nFI: PVSFixedFileInfo;\nVerSize: DWORD;\nbegin\nResult:= False;\nInfoSize:= GetFileVersionInfoSize(PChar(FileName), Wnd);\nif InfoSize <> 0 then begin\nGetMem(VerBuf, InfoSize);\ntry\nif GetFileVersionInfo(PChar(FileName), Wnd, InfoSize, VerBuf) then\nif VerQueryValue(VerBuf, '\\', Pointer(FI), VerSize) then begin\nMajor:= FI.dwFileVersionMS shr 16;\nMinor:= FI.dwFileVersionMS and $FFFF;\nRelease:= FI.dwFileVersionLS shr 16;\nBuild:= FI.dwFileVersionLS and $FFFF;\nResult:= True;\nend;\nfinally\nFreeMem(VerBuf);\nend;\nend;\nend;\n\nIlya Katargin <ilya.Katargin@f9.n5029.z2.fidonet.org>\n-------------------------------------------------------\n\nfunction  GetFileVersion(FName: TFileName): String;\nvar\nS: String;\nn, Len: Cardinal;\nBuf, Value: PChar;\nbegin\nResult:='';\nS := FName;\nn := GetFileVersionInfoSize(PChar(S), n);\nif n = 0 then Exit;\nBuf := AllocMem(n);\nGetFileVersionInfo(PChar(S), 0, n, Buf);\nif VerQueryValue(Buf, PChar('StringFileInfo\\041904E3\\FileVersion'),\nPointer(Value), Len) then\nResult:=Value;\nFreeMem(Buf, n);\nend;\n\n\u0448\u0435\u043f <\u0448\u0435\u043f@p256.f1355.n5020.z2.fidonet.org>\n-------------------------------------------------\n\n> if VerQueryValue(Buf, PChar('StringFileInfo\\041904E3\\FileVersion'),\n\n\u0417\u0434\u0435\u0441\u044c \u0436\u0435\u0441\u0442\u043a\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d \u044f\u0437\u044b\u043a \u0438 \u043a\u043e\u0434\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 '041904E3'.\n\u0412 \u0445\u0435\u043b\u043f\u0435 \u043a \u04146 \u0442\u043e\u0436\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0436\u0435\u0441\u0442\u043a\u043e: '040904E4' (\u0441\u043c. Reading version\ninformation \u0432 \u0445\u0435\u043b\u043f\u0435). \u042f ,\u043a\u0441\u0442\u0430\u0442\u0438, \u0441\u0430\u043c \u043d\u0435 \u0441\u0440\u0430\u0437\u0443 \u0441\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\n\u0432 \u0445\u0435\u043b\u043f\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 :(\n\u0410 \u0432\u0435\u0434\u044c \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0442\u0430\u043c \u0436\u0435:\ntype\nTLangChrSet = array[0..1] of word;\nPLangChrset = ^TLangChrSet;\nvar\nLangChrSet: PLangChrSet;\n...\n\u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f FileVersionInfo\nVerQueryValue(Buf, PChar('VarFileInfo\\Translation'),\npointer(LangChrset), Len);\nS:=Format('%.4x%.4x',[LangChrSet^[0], LangChrSet^[1]]);\n\u0442\u0435\u043f\u0435\u0440\u044c \u0432 S \u0443 \u043d\u0430\u0441 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e :)\n<\/div><\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u0430\u043a \u0443\u0437\u043d\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[448,454],"tags":[1237,937],"_links":{"self":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/756"}],"collection":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=756"}],"version-history":[{"count":0,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/756\/revisions"}],"wp:attachment":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=756"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}