{"id":16,"date":"2007-03-02T15:28:55","date_gmt":"2007-03-02T12:28:55","guid":{"rendered":"http:\/\/pblog.ru\/?p=16"},"modified":"2008-09-09T10:01:23","modified_gmt":"2008-09-09T07:01:23","slug":"%d1%80%d0%b5%d0%b5%d1%81%d1%82%d1%80","status":"publish","type":"post","link":"http:\/\/pblog.ru\/?p=16","title":{"rendered":"\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0440\u0435\u0435\u0441\u0442\u0440\u043e\u043c"},"content":{"rendered":"<p>\u0420\u0435\u0435\u0441\u0442\u0440 \u043e\u0447\u0435\u043d\u044c \u043d\u0443\u0436\u043d\u0430\u044f \u0432\u0435\u0449\u044c! \u0418\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043c\u0435\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0412\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<br \/>\n\u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 uses \u043c\u043e\u0434\u0443\u043b\u044c Registry<br \/>\n\u0417\u0430\u0442\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0432\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b:<br \/>\n<pre><code>type<br \/>\n  TForm1 = class(TForm)<br \/>\n    procedure SaveProgParam;<br \/>\n    procedure LoadProgParam;<\/p>\n<p>procedure TForm1.SaveProgParam;<br \/>\nvar<br \/>\n FIniFile: TRegIniFile;<br \/>\nBegin<br \/>\n\/\/ \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u0441\u0451 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432 HKEY_CURRENT_USER<br \/>\n FIniFile := TRegIniFile.Create('Software');<br \/>\n FIniFile.OpenKey('\u041f\u0430\u043f\u043a\u0430_\u0432\u0430\u0448\u0435\u0439_\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b',true);<br \/>\nif Form1.WindowState=wsNormal then<br \/>\n  begin<br \/>\n   FIniFile.WriteInteger('Option', 'Width', Width);<br \/>\n\/\/ Write\u2026 - \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c, \u2026Integer \u2013 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0442\u0438\u043f \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<br \/>\n\/\/ \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 'Option' \u2013 \u044d\u0442\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b: '\u041f\u0430\u043f\u043a\u0430_\u0432\u0430\u0448\u0435\u0439_\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b\\Option\\'<br \/>\n\/\/ \u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 'Width' \u2013 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430 (\u0444\u0430\u0439\u043b\u0430 \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0435)<br \/>\n\/\/ \u0422\u0440\u0435\u0442\u0438\u0439 \u2013 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c<br \/>\n   FIniFile.WriteInteger('Option', 'Heigth', Height);<br \/>\n   FIniFile.WriteInteger('Option', 'Left', Left);<br \/>\n   FIniFile.WriteInteger('Option', 'Top', Top);<br \/>\n  end;<br \/>\n FIniFile.WriteInteger('Option', 'WinState', Integer(WindowState));<br \/>\n FIniFile.Free; \/\/\u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e<br \/>\nend;<br \/>\n<\/code><\/pre><br \/>\n\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043a\u043d\u0430 \u0438 \u0440\u0430\u0437\u0432\u0451\u0440\u043d\u0443\u0442\u043e \u043b\u0438 \u043e\u043d\u043e. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u044d\u0442\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432:<br \/>\n<!--more--><br \/>\n<pre><code>procedure TForm1.LoadProgParam;<br \/>\nvar<br \/>\n FIniFile: TRegIniFile;<br \/>\nBegin<br \/>\n\/\/ \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u0441\u0451 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432 HKEY_CURRENT_USER<br \/>\n FIniFile := TRegIniFile.Create('Software');<br \/>\n FIniFile.OpenKey('\u041f\u0430\u043f\u043a\u0430_\u0432\u0430\u0448\u0435\u0439_\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b',true);<br \/>\nWidth:=FIniFile.ReadInteger('Option', 'Width', 600);<br \/>\n\/\/ Read\u2026 - \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u0435\u043d\u0438\u0435, \u2026Integer \u2013 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0442\u0438\u043f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<br \/>\n\/\/ \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 'Option' \u2013 \u044d\u0442\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b: '\u041f\u0430\u043f\u043a\u0430_\u0432\u0430\u0448\u0435\u0439_\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b\\Option\\'<br \/>\n\/\/ \u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 'Width' \u2013 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430 (\u0444\u0430\u0439\u043b\u0430 \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0435)<br \/>\n\/\/ \u0422\u0440\u0435\u0442\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 600 \u2013 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0435\u0441\u043b\u0438 \u043a\u043b\u044e\u0447 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c 'Width'  \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0434\u0435\u043d<br \/>\n Height:=FIniFile.ReadInteger('Option', 'Heigth', 300);<br \/>\n Left:=FIniFile.ReadInteger('Option', 'Left', 10);<br \/>\n Top:=FIniFile.ReadInteger('Option', 'Top', 10);<br \/>\n WindowState:=TWindowState(FIniFile.ReadInteger('Option', 'WinState', 0));<br \/>\n FIniFile.Free; \/\/\u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e<br \/>\nend;<\/code><\/pre><\/p>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u043c \u044d\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443:<\/p>\n<pre><code>procedure TForm1.FormCreate(Sender: TObject);<br \/>\nbegin<br \/>\nLoadProgParam;<br \/>\nend;<\/p>\n<p>procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);<br \/>\nbegin<br \/>\nSaveProgParam;<br \/>\nend;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0420\u0435\u0435\u0441\u0442\u0440 \u043e\u0447\u0435\u043d\u044c \u043d\u0443\u0436\u043d\u0430\u044f \u0432\u0435\u0449\u044c! \u0418\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043c\u0435\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0412\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 uses \u043c\u043e\u0434\u0443\u043b\u044c Registry \u0417\u0430\u0442\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0432\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b: \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043a\u043d\u0430 \u0438 \u0440\u0430\u0437\u0432\u0451\u0440\u043d\u0443\u0442\u043e \u043b\u0438 \u043e\u043d\u043e. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u044d\u0442\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432:<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,15],"tags":[333,331,328,334,332,255,326,257,329,327,330,325],"_links":{"self":[{"href":"http:\/\/pblog.ru\/index.php?rest_route=\/wp\/v2\/posts\/16"}],"collection":[{"href":"http:\/\/pblog.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pblog.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pblog.ru\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"http:\/\/pblog.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16"}],"version-history":[{"count":4,"href":"http:\/\/pblog.ru\/index.php?rest_route=\/wp\/v2\/posts\/16\/revisions"}],"predecessor-version":[{"id":225,"href":"http:\/\/pblog.ru\/index.php?rest_route=\/wp\/v2\/posts\/16\/revisions\/225"}],"wp:attachment":[{"href":"http:\/\/pblog.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pblog.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pblog.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}