{"id":200,"date":"2008-05-02T16:10:04","date_gmt":"2008-05-02T16:10:04","guid":{"rendered":"http:\/\/6teen.ru\/?p=225"},"modified":"2008-05-02T16:10:04","modified_gmt":"2008-05-02T16:10:04","slug":"4468","status":"publish","type":"post","link":"http:\/\/pblog.ru\/lab\/?p=200","title":{"rendered":"\u041a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0438\u0434 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0443\u0440\u0441\u043e\u0440\u0430"},"content":{"rendered":"<p>\u041a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0438\u0434 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0443\u0440\u0441\u043e\u0440\u0430<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 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0438\u0434 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0443\u0440\u0441\u043e\u0440\u0430\n\n\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0432\u0430 \u0446\u0432\u0435\u0442\u043d\u044b\u0445 \"bitmap'\u0430\": \"\u0443\u043b\u044b\u0431\u0447\u0438\u0432\u044b\u0439\" \u0438 \"\u0445\u043c\u0443\u0440\u044b\u0439\" \u0438 \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u0438\u0445 \u043a\u0443\u0440\u0441\u043e\u0440\u0443 edit'\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u043e\u043a\u043e\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 edit'\u0430. \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0430\u0434\u0440\u0435\u0441 \u043e\u043a\u043e\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b Edit'\u0430 \u043d\u0430\u0448\u0438\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c, \u0430 \u0441\u0442\u0430\u0440\u0443\u044e \u043e\u043a\u043e\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \"\u0443\u043b\u044b\u0431\u0447\u0438\u0432\u044b\u0439\" \u043a\u0443\u0440\u0441\u043e\u0440 \u043f\u0440\u0438 \u043d\u0430\u0431\u043e\u0440\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \"\u0445\u043c\u0443\u0440\u044b\u0439\" \u043f\u0440\u0438 \u0437\u0430\u0431\u043e\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0435\u0439 backspace.\n\u041f\u0440\u0438\u043c\u0435\u0440:\n\nunit caret1;\n\ninterface\n\n{$IFDEF WIN32}\nuses\nWindows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;\n{$ELSE}\nuses\nWinTypes, WinProcs, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,\nStdCtrls;\n{$ENDIF}\n\ntype\nTForm1 = class(TForm)\nEdit1: TEdit;\nprocedure FormCreate(Sender: TObject);\nprocedure FormDestroy(Sender: TObject);\nprivate\n{Private declarations}\npublic\n{Public declarations}\nCaretBm : TBitmap;\nCaretBmBk : TBitmap;\nOldEditsWindowProc : Pointer;\nend;\n\nvar\nForm1: TForm1;\n\nimplementation\n{$R *.DFM}\n\ntype\n{$IFDEF WIN32}\nWParameter = LongInt;\n{$ELSE}\nWParameter = Word;\n{$ENDIF}\nLParameter = LongInt;\n\n{New windows procedure for the edit control}\nfunction NewWindowProc(WindowHandle : hWnd; TheMessage : WParameter; ParamW : WParameter; ParamL : LParameter) : LongInt\n{$IFDEF WIN32} stdcall; {$ELSE} ; export; {$ENDIF}\nbegin\n{Call the old edit controls windows procedure}\nNewWindowProc := CallWindowProc(Form1.OldEditsWindowProc, WindowHandle,\nTheMessage, ParamW, ParamL);\nif TheMessage = WM_SETFOCUS then\nbegin\nCreateCaret(WindowHandle, Form1.CaretBm.Handle, 0, 0);\nShowCaret(WindowHandle);\nend;\nif TheMessage = WM_KILLFOCUS then\nbegin\nHideCaret(WindowHandle);\nDestroyCaret;\nend;\nif TheMessage = WM_KEYDOWN then\nbegin\nif ParamW = VK_BACK then\nCreateCaret(WindowHandle, Form1.CaretBmBk.Handle, 0, 0) else\nCreateCaret(WindowHandle, Form1.CaretBm.Handle, 0, 0);\nShowCaret(WindowHandle);\nend;\nend;\n\nprocedure TForm1.FormCreate(Sender: TObject);\nbegin\n{Create a smiling bitmap using the wingdings font}\nCaretBm := TBitmap.Create;\nCaretBm.Canvas.Font.Name := 'WingDings';\nCaretBm.Canvas.Font.Height := Edit1.Font.Height;\nCaretBm.Canvas.Font.Color := clWhite;\nCaretBm.Width := CaretBm.Canvas.TextWidth('J') + 2;\nCaretBm.Height := CaretBm.Canvas.TextHeight('J') + 2;\nCaretBm.Canvas.Brush.Color := clBlue;\nCaretBm.Canvas.FillRect(Rect(0, 0, CaretBm.Width, CaretBm.Height));\nCaretBm.Canvas.TextOut(1, 1, 'J');\n{Create a frowming bitmap using the wingdings font}\nCaretBmBk := TBitmap.Create;\nCaretBmBk.Canvas.Font.Name := 'WingDings';\nCaretBmBk.Canvas.Font.Height := Edit1.Font.Height;\nCaretBmBk.Canvas.Font.Color := clWhite;\nCaretBmBk.Width := CaretBmBk.Canvas.TextWidth('L') + 2;\nCaretBmBk.Height := CaretBmBk.Canvas.TextHeight('L') + 2;\nCaretBmBk.Canvas.Brush.Color := clBlue;\nCaretBmBk.Canvas.FillRect(Rect(0,0, CaretBmBk.Width, CaretBmBk.Height));\nCaretBmBk.Canvas.TextOut(1, 1, 'L');\n{Hook the edit controls window procedure}\nOldEditsWindowProc := Pointer(SetWindowLong(Edit1.Handle,GWL_WNDPROC,\nLongInt(@NewWindowProc)));\nend;\n\nprocedure TForm1.FormDestroy(Sender: TObject);\nbegin\n{Unhook the edit controls window procedure and clean up}\nSetWindowLong(Edit1.Handle,GWL_WNDPROC, LongInt(OldEditsWindowProc));\nCaretBm.Free;\nCaretBmBk.Free;\nend;\n<\/div><\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0438\u0434 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0443\u0440\u0441\u043e\u0440\u0430<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,456],"tags":[636,760,825,1015],"_links":{"self":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/200"}],"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=200"}],"version-history":[{"count":0,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/200\/revisions"}],"wp:attachment":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=200"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}