{"id":158,"date":"2019-09-30T22:17:27","date_gmt":"2019-09-30T19:17:27","guid":{"rendered":"http:\/\/www.potansif.com\/?p=158"},"modified":"2019-09-30T22:17:27","modified_gmt":"2019-09-30T19:17:27","slug":"twebbrowser-lafinizi-dinlesin-html-5ten-anlasin","status":"publish","type":"post","link":"http:\/\/www.potansif.com\/?p=158","title":{"rendered":"TWebBrowser Laf\u0131n\u0131z\u0131 Dinlesin, HTML 5&#8217;ten Anlas\u0131n"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-619 alignright\" src=\"http:\/\/rubicube.com.tr\/wp-content\/uploads\/2018\/09\/AyXzq01.gif\" alt=\"\" width=\"322\" height=\"551\"><\/p>\n<p>Merhaba, Bu yaz\u0131m\u0131zda TWebBrowser nesnesinde do\u011frudan HTML kodlar\u0131n\u0131 nas\u0131l \u00e7al\u0131\u015ft\u0131raca\u011f\u0131m\u0131z\u0131, bir resmi, foto\u011fraf\u0131 disk i\u015flemlerini kullanmadan do\u011frudan nas\u0131l HTML koduna g\u00f6mebilece\u011fimizi, HTML5 ile birlikte gelen baz\u0131 yenilikleri nas\u0131l kullanabilece\u011fimizi, bu \u00e7er\u00e7evede bir vekt\u00f6r grafi\u011fi nas\u0131l olu\u015fturabilece\u011fimizi inceleyece\u011fiz. T\u00fcm bunlar\u0131 yapabilmek i\u00e7in \u00f6nce TWebBrowser nesnesinde do\u011frudan nas\u0131l HTML kodlar\u0131 \u00e7al\u0131\u015ft\u0131rabilece\u011fimizin alt yap\u0131s\u0131n\u0131 kurmay\u0131 ve IE&#8217;nin HTML5 anlar hale nas\u0131l getirilece\u011fi gibi sorunlar\u0131 nas\u0131l a\u015fabilece\u011fimize bakaca\u011f\u0131z.<br \/>\n<!--more--><br \/>\nMakalemizdeki \u00f6rnek kodlar\u0131n d\u00fczg\u00fcn \u00e7al\u0131\u015fabilmesi i\u00e7in XE2 ve \u00fczeri bir Delphi s\u00fcr\u00fcm\u00fc kullanman\u0131z gerekecek. E\u011fer daha eski Delphi s\u00fcr\u00fcmlerini kullan\u0131yorsan\u0131z \u00fcz\u00fclmeyin, a\u015fa\u011f\u0131da payla\u015faca\u011f\u0131m linklerde sizin s\u00fcr\u00fcmlere uyan \u00f6rnek kodlar bulman\u0131z da m\u00fcmk\u00fcn olabilir. Lazarus i\u00e7in hen\u00fcz bir denemem olmad\u0131. (Muhtemelen Lazarus&#8217;ta \u00e7al\u0131\u015fmayacakt\u0131r)<\/p>\n<ul>\n<li><a href=\"https:\/\/grahamwideman.wikispaces.com\/Delphi+TWebBrowser+notes\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/grahamwideman.wikispaces.com\/Delphi+TWebBrowser+notes<\/a><\/li>\n<li><a href=\"http:\/\/delphidabbler.com\/articles?article=14\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/delphidabbler.com\/articles?article=14<\/a><\/li>\n<li><a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/aa752047(VS.85).aspx\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/msdn.microsoft.com\/en-us\/library\/aa752047(VS.85).aspx<\/a>&nbsp; &nbsp;(C++)<\/li>\n<li><a href=\"https:\/\/www.codeproject.com\/KB\/IP\/parse_html.aspx?fid=3219\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.codeproject.com\/KB\/IP\/parse_html.aspx?fid=3219<\/a>&nbsp; &nbsp; &nbsp; (C++)<\/li>\n<\/ul>\n<p>Haydi ba\u015flayal\u0131m;<\/p>\n<p>TWebBrowser&#8217;in HTML kodlar\u0131n\u0131 do\u011frudan \u00e7al\u0131\u015ft\u0131rabilmesi ve ekranda g\u00f6sterebilmesi i\u00e7in <b>IPersistStreamInit<\/b> arabiriminden faydalanaca\u011f\u0131z. Kodlar\u0131n ta\u015f\u0131nabilirli\u011fini artt\u0131rmak ve gereksiz WITH kullan\u0131m\u0131n\u0131 \u00f6nlemek ad\u0131na biz bu kodlar\u0131 <b>CLASS HELPER<\/b> tekni\u011fini kullanarak yazaca\u011f\u0131z. Gerekli a\u00e7\u0131klamalar kod i\u00e7erisinde yer alaca\u011f\u0131 i\u00e7in ayr\u0131ca a\u00e7\u0131klama yap\u0131lmayacak. \u015eahsen yaz\u0131lan kodun karma\u015f\u0131k olmas\u0131n\u0131 sevmem ve tercih de etmem, ahengin basitlikte yatt\u0131\u011f\u0131na inan\u0131r ve o do\u011frultuda ilerlemeyi tercih ederim. Dolay\u0131s\u0131yla kodlar olabildi\u011fince sade ve basit tutulmaya \u00e7al\u0131\u015f\u0131ld\u0131.<\/p>\n<pre><code>...\n...\ninterface\n\nuses\n&nbsp; Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,\n&nbsp; Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.OleCtrls, SHDocVw, Vcl.StdCtrls;\n\ntype\n&nbsp; TForm1 = class(TForm)\n&nbsp; &nbsp; Button1: TButton;\n&nbsp; &nbsp; WebBrowser1: TWebBrowser;\n&nbsp; &nbsp; procedure Button1Click(Sender: TObject);\n&nbsp; private\n&nbsp; &nbsp; { Private declarations }\n&nbsp; public\n&nbsp; &nbsp; { Public declarations }\n&nbsp; end;\n\n&nbsp; \/\/ BU KISMI AYRI B\u0130R UNIT'E ALAB\u0130L\u0130RS\u0130N\u0130Z...\n\n&nbsp; TWebBrowserHelper = class helper for TWebBrowser&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ S\u0131n\u0131f hizmet\u00e7isi\n&nbsp; &nbsp; public\n&nbsp; &nbsp; &nbsp; procedure RunHTML(aHTMLCode: String; aApplication: TApplication);&nbsp; &nbsp; \/\/ Do\u011frudan HTML kodlar\u0131n\u0131 \u00e7al\u0131\u015ft\u0131racak olan yordam\u0131m\u0131z\n&nbsp; &nbsp; &nbsp; function GetHTML: String;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ TWebBrowser nesnesindeki HTML kodu\n&nbsp; &nbsp; &nbsp; function GetTEXT: String;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ TWebBrowser nesnesinde g\u00f6sterilen sayfadaki text (HTML kodu i\u00e7ermez, d\u00fcz metindir...)\n&nbsp; end;\n&nbsp; TIEMode = (iemUnknown, iemIE7, iemIE8, iemIE9, iemIE10, iemIE11);\n&nbsp; function SetupIEMode(aAyarla: Boolean; IE_Kipi: TIEMode): LongInt;&nbsp; &nbsp; &nbsp; &nbsp;\/\/ Internet Explorer'in hangi versiyon kipinde \u00e7al\u0131\u015faca\u011f\u0131n\u0131 Y\u00d6NET\u0130R\n&nbsp; function SetIEMode(Mode: TIEMode): boolean;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Internet Explorer'in hangi versiyon kipinde \u00e7al\u0131\u015faca\u011f\u0131n\u0131 BEL\u0130RLER\n&nbsp; function GetIEMode: TIEMode;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ Internet Explorer'in hangi versiyon kipinde \u00e7al\u0131\u015ft\u0131\u011f\u0131n\u0131 OKUR\n\nvar\n&nbsp; Form1: TForm1;\n\nimplementation\n\n{$R *.dfm}\n\nuses\n&nbsp; &nbsp; Winapi.ActiveX&nbsp; &nbsp; &nbsp; &nbsp; \/\/&nbsp; IPersistStreamInit\n&nbsp; , MSHTML&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/&nbsp; IHTMLElement\n&nbsp; , System.Win.Registry&nbsp; &nbsp;\/\/&nbsp; TRegistry\n&nbsp; ;\n\n{ TWebBrowserHelper }\n\nprocedure TWebBrowserHelper.RunHTML(aHTMLCode: String; aApplication: TApplication);\nvar\n&nbsp; SS: TStringStream;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ HTML Kodlar\u0131m\u0131z\u0131TWebBrowser'a aktarmak i\u00e7in kullanaca\u011f\u0131z\nbegin\n&nbsp; Navigate('about:blank');&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ TWebBrowser nesnesine temiz bir sayfa a\u00e7\u0131yoruz.\n&nbsp; try\n&nbsp; &nbsp; while (ReadyState &lt; READYSTATE_INTERACTIVE)&nbsp; \/\/ TWebBrowser'in i\u015finin bitmesini bekliyoruz. Bu arada ana thread'imizin rutinine devam etmesini sa\u011fl\u0131yoruz.\n&nbsp; &nbsp; &nbsp; &nbsp;do aApplication.ProcessMessages;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ ProcessMessage'nin bu tarz kullan\u0131m\u0131 pek \u00f6nerilmeyebiliyor OnDocumentComplete ve READYSTATE_COMPLETE kullan\u0131m\u0131\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ da \u00f6nerilmektedir fakat bizim \u00f6rne\u011fimiz i\u00e7in ProcessMessage kullanmak yeterli olacakt\u0131r.\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ Daha kompleks, daha sa\u011flamc\u0131 yap\u0131lar kurmak isterseniz yukar\u0131da de\u011findi\u011fim olay i\u015fleyici\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ ve durum bayra\u011f\u0131n\u0131 kullanmak faydal\u0131 olabilir...\n&nbsp; finally\n&nbsp; &nbsp; if (Assigned(Document) = TRUE) then begin&nbsp; &nbsp; \/\/ TWebBrowser bo\u015f sayfam\u0131z\u0131 i\u015flemeye haz\u0131r ise y\u00fckleme i\u015flemine ba\u015flayabiliriz...\n&nbsp; &nbsp; &nbsp; &nbsp; SS := TStringStream.Create;\n&nbsp; &nbsp; &nbsp; &nbsp; SS.WriteString(aHTMLCode);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ HTML kodlar\u0131m\u0131z\u0131 StringStream'\u0131m\u0131za y\u00fckl\u00fcyoruz.\n&nbsp; &nbsp; &nbsp; &nbsp; try\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SS.Seek(0, 0);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ StringStream'in ilk bayt\u0131na pozisyonumuzu al\u0131yoruz.\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (Document as IPersistStreamInit)\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Load(TStreamAdapter.Create(SS));&nbsp; &nbsp; &nbsp; \/\/ TWebBrowser'in Document nesnesine IPersistStreamInit arabirimi vas\u0131tas\u0131yla HTML i\u00e7eri\u011fimizi y\u00fckl\u00fcyoruz.\n&nbsp; &nbsp; &nbsp; &nbsp; finally\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SS.Free;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ Bitti, hepsi bu kadar. Art\u0131k HTML kodlar\u0131n\u0131n\u0131n sonucunu bir web sayfas\u0131 olarak g\u00f6rebiliriz...\n&nbsp; &nbsp; &nbsp; &nbsp; end;\n&nbsp; &nbsp; end;\n&nbsp; end;\nend;\n\nfunction TWebBrowserHelper.GetHTML: String;\nVar\n&nbsp; E: IHTMLElement;\nbegin\n&nbsp; Result := '';\n&nbsp; if (Assigned(Document) = TRUE) then begin\n&nbsp; &nbsp; &nbsp; E := (Document as IHTMLDocument2).body;\n&nbsp; &nbsp; &nbsp; while (E.parentElement &lt;&gt; nil) do E := E.parentElement;\n&nbsp; &nbsp; &nbsp; Result := E.outerHTML;\n&nbsp; end;\nend;\n\nfunction TWebBrowserHelper.GetTEXT: String;\nvar\n&nbsp; Bodi : IHTMLElement;\nbegin\n&nbsp; Result := '';\n&nbsp; if&nbsp; (Assigned(Document) = TRUE)\n&nbsp; then Result := (Document as IHTMLDocument2).body.innerText;\nend;<\/code><\/pre>\n<p>TWebBrowser nesnemize do\u011frudan HTML kodlar\u0131n\u0131 \u00e7al\u0131\u015ft\u0131rma yetene\u011fi kazand\u0131rm\u0131\u015f olduk. Fakat IE varsay\u0131lan olarak HTML5 diyalekti\u011fini kullanmaya ayarlanmad\u0131\u011f\u0131 i\u00e7in HTML5 kodlar\u0131n\u0131 \u00e7al\u0131\u015ft\u0131rmak istedi\u011finizde bo\u015f bir sayfa ile kar\u015f\u0131la\u015fabilir veya HTML5 komutlar\u0131n\u0131n g\u00f6zard\u0131 edildi\u011fini g\u00f6rebilirsiniz. Bu sorunu a\u015fmak i\u00e7in ise Registry&#8217;de bir ayarlama yapmam\u0131z gerekir. Bunu yapsak bile bu ayar\u0131 TWebBrowser nesnesini bar\u0131nd\u0131ran formun SHOW edilmeden \u00f6nce ger\u00e7ekle\u015ftirilmesi i\u015fletim sistemi taraf\u0131ndan beklenir&#8230;<br \/>\nDolay\u0131s\u0131yla a\u015fa\u011f\u0131da yer alan \u00f6rnek kodlar\u0131 kullanmak i\u00e7in formun create edildi\u011fi fakat hen\u00fcz show edilmedi\u011fi bir noktada bu kodlar\u0131 \u00e7a\u011f\u0131rman\u0131z gerekecektir. Esasen bu kodlar\u0131n t\u00fcm uygulama ya\u015fam d\u00f6ng\u00fcs\u00fc boyunca sadece 1 defa \u00e7al\u0131\u015ft\u0131r\u0131lmas\u0131 yeterli olacakt\u0131r.<\/p>\n<pre><code>function SetupIEMode(aAyarla: Boolean; IE_Kipi: TIEMode): LongInt;\nconst\n&nbsp; REG_KEY = 'Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION';\nvar\n&nbsp; Reg&nbsp; &nbsp; &nbsp;: TRegistry;\n&nbsp; Value&nbsp; &nbsp;: LongInt;\n&nbsp; I&nbsp; &nbsp; &nbsp; &nbsp;: LongInt;\n&nbsp; Uygulama: String;\nbegin\n\n&nbsp; Result := 0;\n&nbsp; if&nbsp; (aAyarla = TRUE )\n&nbsp; and ( IE_Kipi = iemUnknown ) then Exit;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ IE'nin bilinmeyen (muhtemelen daha yeni) bir s\u00fcr\u00fcm\u00fcyse \u00e7\u0131k...\n\n&nbsp; Uygulama := ExtractFileName(ParamStr(0));&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ Kendi uygulamam\u0131z\u0131n EXE ad\u0131 (Mesela \"Project1.exe\" gibi...)\n\n&nbsp; Value := 0;\n&nbsp; if (aAyarla = TRUE ) then begin&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ A\u015fa\u011f\u0131daki k\u0131s\u0131m ile ilgili olarak \u015fu linki incelemenizi tavsiye ederim;\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ http:\/\/www.ahmetaltay.com.tr\/2016\/02\/delphi-twebbrowser-emulasyonu\/\n&nbsp; &nbsp; &nbsp;case IE_Kipi of&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ IE'nin ne \u015fekilde \u00e7al\u0131\u015faca\u011f\u0131n\u0131 se\u00e7iyoruz...\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iemIE7 : Value := 7000;\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iemIE8 : Value := 8888;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ IE 8&nbsp; + DOCTYPE spesifikasyonunu destekler\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iemIE9 : Value := 9999;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ IE 9&nbsp; + DOCTYPE spesifikasyonunu destekler\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iemIE10: Value := 10001;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ IE 10 + DOCTYPE spesifikasyonunu destekler\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iemIE11: Value := 11001;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ IE 11 + DOCTYPE spesifikasyonunu destekler\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else&nbsp; &nbsp; &nbsp;Value := 11001;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ IE 11 ve \u00fczeriise IE11 + DOCTYPE spesifikasyonunu destekler\n&nbsp; &nbsp; &nbsp; end;\n&nbsp; end;\n\n&nbsp; Reg := nil;\n&nbsp; try\n&nbsp; &nbsp; \/\/ Bu noktada uygulamam\u0131z i\u00e7in REGISTRY'de bir ayarlama yap\u0131yoruz\n&nbsp; &nbsp; \/\/ Bu ayarlama uygulamam\u0131z\u0131n hangi IE s\u00fcr\u00fcm\u00fcyle \u00e7al\u0131\u015faca\u011f\u0131n\u0131\n&nbsp; &nbsp; \/\/ \u0130\u015fletim sistemine s\u00f6ylemi\u015f olacak...\n&nbsp; &nbsp; Reg := TRegistry.Create();\n&nbsp; &nbsp; Reg.RootKey := HKEY_CURRENT_USER;\n&nbsp; &nbsp; if (Reg.OpenKey(REG_KEY, True) ) then begin\n&nbsp; &nbsp; &nbsp; &nbsp; if (aAyarla = TRUE) then begin\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Reg.WriteInteger(Uygulama, Value);\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Result := Value;\n&nbsp; &nbsp; &nbsp; &nbsp; end else begin\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Value := Reg.ReadInteger( Uygulama );\n&nbsp; &nbsp; &nbsp; &nbsp; end;\n&nbsp; &nbsp; &nbsp; &nbsp; Reg.CloseKey;\n&nbsp; &nbsp; end;\n&nbsp; except;\n&nbsp; &nbsp; \/\/ Herhangi bir hata mesaj\u0131 g\u00f6rmek istemiyoruz...\n&nbsp; end;\n\n&nbsp; if (Assigned(Reg) = TRUE) then FreeAndNil(Reg);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ REG nesnesinin Temizli\u011fi...\n\n&nbsp; if (aAyarla = FALSE) and (Value &gt; 0) then begin\n&nbsp; &nbsp; &nbsp; I := Value div 1000;\n&nbsp; &nbsp; &nbsp; if (I &gt;= 7) and (I &lt;= 11) then begin &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case I of &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7000 : Result := Byte(iemIE7); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8888 : Result := Byte(iemIE8); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;9999 : Result := Byte(iemIE9); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;10001: Result := Byte(iemIE10); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;11001: Result := Byte(iemIE11); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else&nbsp; &nbsp; if (I &gt;= 12) then Result := Byte(iemIE11);\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;\n&nbsp; &nbsp; &nbsp; end;\n&nbsp; end;\nend;\n\nfunction SetIEMode(Mode: TIEMode): boolean;\nbegin\n&nbsp; Result := ( SetupIEMode(TRUE, Mode) &gt; 0 );\nend;\n\nfunction GetIEMode: TIEMode;\nbegin\n&nbsp; Result := TIEMode( Byte( SetupIEMode(FALSE, iemUnknown) ) );\nend;<\/code><\/pre>\n<p>Bu noktadan sonra uygulaman\u0131z\u0131n ana formunun en alt sat\u0131r\u0131n\u0131 \u015fu \u015fekilde d\u00fczenlemeniz HTML5 kodlar\u0131n\u0131 TWebBrowser \u00fczerinde \u00e7al\u0131\u015ft\u0131rman\u0131za imkan tan\u0131yacakt\u0131r.<\/p>\n<pre><code>initialization\n&nbsp; SetIEMode( iemIE11);\nend.<\/code><\/pre>\n<p>\u00d6rnek uygulama i\u00e7in bo\u015f bir VCL Projesi olu\u015fturup form \u00fczerine bir adet TWEBBROWSER ve bir adet TButton nesnesi ekleyin. Button1 nesnesinin onclick olay\u0131na a\u015fa\u011f\u0131daki kodu yaz\u0131p \u00e7al\u0131\u015ft\u0131r\u0131n. Butona bast\u0131\u011f\u0131nz\u0131da WebBrowser1&#8217;de yazd\u0131\u011f\u0131n\u0131z HTML kodlar\u0131n\u0131n derlendi\u011fini g\u00f6receksiniz.<\/p>\n<p><b>Kod b\u00fct\u00fcnl\u00fc\u011f\u00fcn\u00fcn bozulmamas\u0131 ad\u0131na .pas ve .dfm dosya i\u00e7eri\u011fini a\u015fa\u011f\u0131da payla\u015f\u0131yorum;<\/b><\/p>\n<pre><code>unit Ana_;\n\ninterface\n\nuses\n&nbsp; Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,\n&nbsp; Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.OleCtrls, SHDocVw, Vcl.StdCtrls;\n\ntype\n&nbsp; TForm1 = class(TForm)\n&nbsp; &nbsp; Button1: TButton;\n&nbsp; &nbsp; WebBrowser1: TWebBrowser;\n&nbsp; &nbsp; procedure Button1Click(Sender: TObject);\n&nbsp; private\n&nbsp; &nbsp; { Private declarations }\n&nbsp; public\n&nbsp; &nbsp; { Public declarations }\n&nbsp; end;\n\n&nbsp; \/\/ BU KISMI AYRI B\u0130R UNIT'E ALAB\u0130L\u0130RS\u0130N\u0130Z...\n\n&nbsp; TWebBrowserHelper = class helper for TWebBrowser&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ S\u0131n\u0131f hizmet\u00e7isi\n&nbsp; &nbsp; public\n&nbsp; &nbsp; &nbsp; procedure RunHTML(aHTMLCode: String; aApplication: TApplication);&nbsp; &nbsp; \/\/ Do\u011frudan HTML kodlar\u0131n\u0131 \u00e7al\u0131\u015ft\u0131racak olan yordam\u0131m\u0131z\n&nbsp; &nbsp; &nbsp; function GetHTML: String;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ TWebBrowser nesnesindeki HTML kodu\n&nbsp; &nbsp; &nbsp; function GetTEXT: String;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ TWebBrowser nesnesinde g\u00f6sterilen sayfadaki text (HTML kodu i\u00e7ermez, d\u00fcz metindir...)\n&nbsp; end;\n&nbsp; TIEMode = (iemUnknown, iemIE7, iemIE8, iemIE9, iemIE10, iemIE11);\n&nbsp; function SetupIEMode(aAyarla: Boolean; IE_Kipi: TIEMode): LongInt;&nbsp; &nbsp; &nbsp; &nbsp;\/\/ Internet Explorer'in hangi versiyon kipinde \u00e7al\u0131\u015faca\u011f\u0131n\u0131 Y\u00d6NET\u0130R\n&nbsp; function SetIEMode(Mode: TIEMode): boolean;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Internet Explorer'in hangi versiyon kipinde \u00e7al\u0131\u015faca\u011f\u0131n\u0131 BEL\u0130RLER\n&nbsp; function GetIEMode: TIEMode;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ Internet Explorer'in hangi versiyon kipinde \u00e7al\u0131\u015ft\u0131\u011f\u0131n\u0131 OKUR\n\nvar\n&nbsp; Form1: TForm1;\n\nimplementation\n\n{$R *.dfm}\n\nuses\n&nbsp; &nbsp; Winapi.ActiveX&nbsp; &nbsp; &nbsp; &nbsp; \/\/&nbsp; IPersistStreamInit\n&nbsp; , MSHTML&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/&nbsp; IHTMLElement\n&nbsp; , System.Win.Registry&nbsp; &nbsp;\/\/&nbsp; TRegistry\n&nbsp; ;\n\nprocedure TForm1.Button1Click(Sender: TObject);\nbegin\n&nbsp; WebBrowser1\n&nbsp; .RunHTML( '&lt;!DOCTYPE html&gt;'&nbsp; &nbsp; \/\/ -&gt; HTML5\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&lt;html&gt;'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&lt;body&gt;'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&lt;svg height=\"150\" width=\"400\"&gt;'&nbsp; &nbsp; \/\/ Bir vekt\u00f6rel Grafik (SVG)\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&nbsp; &lt;defs&gt;'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&nbsp; &nbsp; &lt;radialGradient id=\"grad1\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"&gt;'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&nbsp; &nbsp; &nbsp; &lt;stop offset=\"0%\" style=\"stop-color:rgb(255,255,0);stop-opacity:1\" \/&gt;'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&nbsp; &nbsp; &nbsp; &lt;stop offset=\"100%\" style=\"stop-color:rgb(255,0,0);stop-opacity:1\" \/&gt;'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&nbsp; &nbsp; &lt;\/radialGradient&gt;'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&nbsp; &lt;\/defs&gt;'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&nbsp; &lt;rect width=\"300\" height=\"100\" style=\"fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)\" \/&gt;'&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Dikd\u00f6rtgen (Vekt\u00f6r bazl\u0131d\u0131r...)\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&nbsp; &lt;ellipse cx=\"200\" cy=\"70\" rx=\"85\" ry=\"55\" stroke=\"black\" stroke-width=\"4\" fill=\"url(#grad1)\" \/&gt;'&nbsp; &nbsp; &nbsp;\/\/ Elips\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&nbsp; &lt;text fill=\"#ffffff\" font-size=\"20\" font-family=\"Calibri\" x=\"140\" y=\"80\"&gt;U\u011fur PARLAYAN&lt;\/text&gt;'&nbsp; &nbsp; &nbsp; &nbsp;\/\/ metin\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&nbsp; Maalesef, taray\u0131c\u0131n\u0131z sat\u0131r i\u00e7i SVG desteklemiyor.'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&lt;\/svg&gt;'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&lt;canvas id=\"myCanvas\" width=\"200\" height=\"100\" style=\"border:1px solid #000000;\"&gt;&lt;\/canvas&gt;'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Canvas bir dikd\u00f6rtgen (pixel bazl\u0131d\u0131r...)\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&lt;img alt=\"32x32 Rubicube Logo\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdF' \/\/ bir PNG resim dosyas\u0131...\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + 'NvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAUNSURBVEhLlZZ9UNNlAMcf3rKgSKFICSUUKoo\/KvPy+sPyqn+EozquspArhMISeTFizHivMd7GeBsCG8OBUEAiDGy8CAxTYMaGsCGvEw4HHDBIEETkrWc9j7\/9+G0D+t7nOI7bPp+D5z'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + 'n2A+vb2\/TiMv7uf25bgTrVfYtc6XtlctHwzBr+2Xa3daBieO7J\/G7AuQlSr0PeKOr4vW9qeXW7oS0CRYP3TPndgKcAmRIUQBzIb8\/uGl9cXsWvM7zNArm9M8Z5Co0dktFGDiB2c292Ty\/gVxuYwUCt6r4RUiPSWyl2hLBH1dnZOTU1tbys\/x'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + 'boD6hUKp+yG1o7JK2FokYwSkXNYnF\/f\/\/AwMDExMTS0hJWPJ6ewMLCgkQiOZxZvSGgo0YwSnCA2NjY2OLiInbpBubn59VqdUNDg3NWg9bOlVO8BDAgbmrCbtJmZ2eRcEMA2eGEwkrb7BZsz5YBXyY4HgZ+4gOWWDfQpC8wPT2NnNrAysoKss'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + 'MVFxeZczs0dmg5TrP3+vxZDy9wzBe4fw\/8ksEvVRsCjY3YStrk5CTSagPwfLBereZweRo74wr4+LRHxNHBW2byVhMW3\/Gd065Grr6a0ld0EHoB\/kIw0KgvMD4+jrTawIMHD7Beraan5cD3m7n7xOW5qAfAaDfo\/xtTX2vpxzz0\/BeeMONwkp'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '7\/RwU8MGwlDd5DpNUGiAMYHR2NYTA+\/fHUldrd0A5RKbQBxG2JsaDEsb4mvEDAP0ens5KTRSJRb28v1vf3j4yMIK02AM8d2pVKZXx8fGKc54j8GWSH3JVTAwTJTI9guufZ0O+CAgNhqbCgQNreDgNDQ0NIqw3MzMzIpNKf6XTmUdfKdCfCDh'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + 'nponoJ4jlOgWyn6KLXw88fCY35MjgoIDgoKCUlBR4M0uLA2tpaTU1NmP8ZoePhEvBCc8IT5MBwJ9VLEJdjiwKIKMGbdNaxbF4S\/GMgMw7AO9pSXNps9dotsJcPbGQFpuTAUAfVS0AJPMZFcNV7dW1FG5i\/JpFbOkM7JAM8N1BvTA7ckVG9BA'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + 'YCGhYe\/qMNjJ6NRXZIgpHVhMKIHBiUUr0EmwTUc5pzxoE7bt8QgXjrnWS7Ugr++hN0t1LVCE0gRX\/g7lSnNtDz8hFkbwd2bBd8Qcdvg8ZKwM8Aeemar5cEoLkKKG5QAwEGAgOj13Bg7dGjTlMHFGgGL\/I+soD2DjG4mKNR61KWD5qEQH59i0'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + 'DXUBUOPOxVIjtEBPbw3MwrCqlSvVzg7aCx9wWw9AckvRdxYFZYj+xSsFcAbCLBrohdlnHvmqf5mHETjShSRCr7KVrinlNxB3yiHLzo9iejHGCGznMmB8RdWTgwmZQD7XXAFl7QJGCNYAKrWGAVYbIzxunpJPcdWWEm\/6mN01L2hSTY+TH2e0'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + 'c6eIXZn6BtwDvCwT\/ZMSz3VRgQtTNxoO9b+FFiQ6gpJAJrBrCKNrPJSQrnZEZHxvn7RLxC8epCY78v7SPO4N6ssrpWHBJZ+PYHLFNqKdnCLtPtMy47NS+Px+XmZmZmsFKSIn8NDI76xPfcwRO0l8jeH2LfElRGDo7I4NWBZhwgb2l2TlldJw'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '6JKjz0IXf\/watRTB6HA9W6ZGefT09PYyZG02K+zijy5\/x2pqOnYWWV+vBCDVAGP4Xa2lovXy7n8\/MoAURVlVChUMD\/lfgNOtsiQAw+icB\/8a2tLeXll2CstLRUJpMSjw6bbLsB8nSfrgxuff1fnEkfInYK53IAAAAASUVORK5CYII=\"&gt;'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&lt;\/body&gt;'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + '&lt;\/html&gt;'\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; , Application\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );\nend;\n\n{ TWebBrowserHelper }\n\nprocedure TWebBrowserHelper.RunHTML(aHTMLCode: String; aApplication: TApplication);\nvar\n&nbsp; SS: TStringStream;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ HTML Kodlar\u0131m\u0131z\u0131TWebBrowser'a aktarmak i\u00e7in kullanaca\u011f\u0131z\nbegin\n&nbsp; Navigate('about:blank');&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ TWebBrowser nesnesine temiz bir sayfa a\u00e7\u0131yoruz.\n&nbsp; try\n&nbsp; &nbsp; while (ReadyState &lt; READYSTATE_INTERACTIVE)&nbsp; \/\/ TWebBrowser'in i\u015finin bitmesini bekliyoruz. Bu arada ana thread'imizin rutinine devam etmesini sa\u011fl\u0131yoruz.\n&nbsp; &nbsp; &nbsp; &nbsp;do aApplication.ProcessMessages;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ ProcessMessage'nin bu tarz kullan\u0131m\u0131 pek \u00f6nerilmeyebiliyor OnDocumentComplete ve READYSTATE_COMPLETE kullan\u0131m\u0131\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ da \u00f6nerilmektedir fakat bizim \u00f6rne\u011fimiz i\u00e7in ProcessMessage kullanmak yeterli olacakt\u0131r.\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ Daha kompleks, daha sa\u011flamc\u0131 yap\u0131lar kurmak isterseniz yukar\u0131da de\u011findi\u011fim olay i\u015fleyici\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ ve durum bayra\u011f\u0131n\u0131 kullanmak faydal\u0131 olabilir...\n&nbsp; finally\n&nbsp; &nbsp; if (Assigned(Document) = TRUE) then begin&nbsp; &nbsp; \/\/ TWebBrowser bo\u015f sayfam\u0131z\u0131 i\u015flemeye haz\u0131r ise y\u00fckleme i\u015flemine ba\u015flayabiliriz...\n&nbsp; &nbsp; &nbsp; &nbsp; SS := TStringStream.Create;\n&nbsp; &nbsp; &nbsp; &nbsp; SS.WriteString(aHTMLCode);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ HTML kodlar\u0131m\u0131z\u0131 StringStream'\u0131m\u0131za y\u00fckl\u00fcyoruz.\n&nbsp; &nbsp; &nbsp; &nbsp; try\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SS.Seek(0, 0);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ StringStream'in ilk bayt\u0131na pozisyonumuzu al\u0131yoruz.\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (Document as IPersistStreamInit)\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Load(TStreamAdapter.Create(SS));&nbsp; &nbsp; &nbsp; \/\/ TWebBrowser'in Document nesnesine IPersistStreamInit arabirimi vas\u0131tas\u0131yla HTML i\u00e7eri\u011fimizi y\u00fckl\u00fcyoruz.\n&nbsp; &nbsp; &nbsp; &nbsp; finally\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SS.Free;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ Bitti, hepsi bu kadar. Art\u0131k HTML kodlar\u0131n\u0131n\u0131n sonucunu bir web sayfas\u0131 olarak g\u00f6rebiliriz...\n&nbsp; &nbsp; &nbsp; &nbsp; end;\n&nbsp; &nbsp; end;\n&nbsp; end;\nend;\n\nfunction TWebBrowserHelper.GetHTML: String;\nVar\n&nbsp; E: IHTMLElement;\nbegin\n&nbsp; Result := '';\n&nbsp; if (Assigned(Document) = TRUE) then begin\n&nbsp; &nbsp; &nbsp; E := (Document as IHTMLDocument2).body;\n&nbsp; &nbsp; &nbsp; while (E.parentElement &lt;&gt; nil) do E := E.parentElement;\n&nbsp; &nbsp; &nbsp; Result := E.outerHTML;\n&nbsp; end;\nend;\n\nfunction TWebBrowserHelper.GetTEXT: String;\nvar\n&nbsp; Bodi : IHTMLElement;\nbegin\n&nbsp; Result := '';\n&nbsp; if&nbsp; (Assigned(Document) = TRUE)\n&nbsp; then Result := (Document as IHTMLDocument2).body.innerText;\nend;\n\nfunction SetupIEMode(aAyarla: Boolean; IE_Kipi: TIEMode): LongInt;\nconst\n&nbsp; REG_KEY = 'Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION';\nvar\n&nbsp; Reg&nbsp; &nbsp; &nbsp;: TRegistry;\n&nbsp; Value&nbsp; &nbsp;: LongInt;\n&nbsp; I&nbsp; &nbsp; &nbsp; &nbsp;: LongInt;\n&nbsp; Uygulama: String;\nbegin\n\n&nbsp; Result := 0;\n&nbsp; if&nbsp; (aAyarla = TRUE )\n&nbsp; and ( IE_Kipi = iemUnknown ) then Exit;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ IE'nin bilinmeyen (muhtemelen daha yeni) bir s\u00fcr\u00fcm\u00fcyse \u00e7\u0131k...\n\n&nbsp; Uygulama := ExtractFileName(ParamStr(0));&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Kendi uygulamam\u0131z\u0131n EXE ad\u0131 (Mesela \"Project1.exe\" gibi...)\n\n&nbsp; Value := 0;\n&nbsp; if (aAyarla = TRUE ) then begin&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ A\u015fa\u011f\u0131daki k\u0131s\u0131m ile ilgili olarak \u015fu linki incelemenizi tavsiye ederim;\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ http:\/\/www.ahmetaltay.com.tr\/2016\/02\/delphi-twebbrowser-emulasyonu\/\n&nbsp; &nbsp; &nbsp;case IE_Kipi of&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ IE'nin ne \u015fekilde \u00e7al\u0131\u015faca\u011f\u0131n\u0131 se\u00e7iyoruz...\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iemIE7 : Value := 7000;\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iemIE8 : Value := 8888;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ IE 8&nbsp; + DOCTYPE spesifikasyonunu destekler\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iemIE9 : Value := 9999;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ IE 9&nbsp; + DOCTYPE spesifikasyonunu destekler\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iemIE10: Value := 10001;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ IE 10 + DOCTYPE spesifikasyonunu destekler\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iemIE11: Value := 11001;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ IE 11 + DOCTYPE spesifikasyonunu destekler\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else&nbsp; &nbsp; &nbsp;Value := 11001;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ IE 11 ve \u00fczeriise IE11 + DOCTYPE spesifikasyonunu destekler\n&nbsp; &nbsp; &nbsp; end;\n&nbsp; end;\n\n&nbsp; Reg := nil;\n&nbsp; try\n&nbsp; &nbsp; \/\/ Bu noktada uygulamam\u0131z i\u00e7in REGISTRY'de bir ayarlama yap\u0131yoruz\n&nbsp; &nbsp; \/\/ Bu ayarlama uygulamam\u0131z\u0131n hangi IE s\u00fcr\u00fcm\u00fcyle \u00e7al\u0131\u015faca\u011f\u0131n\u0131\n&nbsp; &nbsp; \/\/ \u0130\u015fletim sistemine s\u00f6ylemi\u015f olacak...\n&nbsp; &nbsp; Reg := TRegistry.Create();\n&nbsp; &nbsp; Reg.RootKey := HKEY_CURRENT_USER;\n&nbsp; &nbsp; if (Reg.OpenKey(REG_KEY, True) ) then begin\n&nbsp; &nbsp; &nbsp; &nbsp; if (aAyarla = TRUE) then begin\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Reg.WriteInteger(Uygulama, Value);\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Result := Value;\n&nbsp; &nbsp; &nbsp; &nbsp; end else begin\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Value := Reg.ReadInteger( Uygulama );\n&nbsp; &nbsp; &nbsp; &nbsp; end;\n&nbsp; &nbsp; &nbsp; &nbsp; Reg.CloseKey;\n&nbsp; &nbsp; end;\n&nbsp; except;\n&nbsp; &nbsp; \/\/ Herhangi bir hata mesaj\u0131 g\u00f6rmek istemiyoruz...\n&nbsp; end;\n\n&nbsp; if (Assigned(Reg) = TRUE) then FreeAndNil(Reg);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ REG nesnesinin Temizli\u011fi...\n\n&nbsp; if (aAyarla = FALSE) and (Value &gt; 0) then begin\n&nbsp; &nbsp; &nbsp; I := Value div 1000;\n&nbsp; &nbsp; &nbsp; if (I &gt;= 7) and (I &lt;= 11) then begin &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case I of &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7000 : Result := Byte(iemIE7); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8888 : Result := Byte(iemIE8); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;9999 : Result := Byte(iemIE9); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;10001: Result := Byte(iemIE10); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;11001: Result := Byte(iemIE11); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else&nbsp; &nbsp; if (I &gt;= 12) then Result := Byte(iemIE11);\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;\n&nbsp; &nbsp; &nbsp; end;\n&nbsp; end;\nend;\n\nfunction SetIEMode(Mode: TIEMode): boolean;\nbegin\n&nbsp; Result := ( SetupIEMode(TRUE, Mode) &gt; 0 );\nend;\n\nfunction GetIEMode: TIEMode;\nbegin\n&nbsp; Result := TIEMode( Byte( SetupIEMode(FALSE, iemUnknown) ) );\nend;\n\ninitialization\n&nbsp; SetIEMode( iemIE11);\n\nend.<\/code><\/pre>\n<p>Bu da DFM dosyas\u0131d\u0131r&#8230;<\/p>\n<pre><code>object Form1: TForm1\n&nbsp; Left = 0\n&nbsp; Top = 0\n&nbsp; Caption = 'Form1'\n&nbsp; ClientHeight = 299\n&nbsp; ClientWidth = 635\n&nbsp; Color = clBtnFace\n&nbsp; Font.Charset = DEFAULT_CHARSET\n&nbsp; Font.Color = clWindowText\n&nbsp; Font.Height = -11\n&nbsp; Font.Name = 'Tahoma'\n&nbsp; Font.Style = []\n&nbsp; OldCreateOrder = False\n&nbsp; DesignSize = (\n&nbsp; &nbsp; 635\n&nbsp; &nbsp; 299)\n&nbsp; PixelsPerInch = 96\n&nbsp; TextHeight = 13\n&nbsp; object Button1: TButton\n&nbsp; &nbsp; Left = 8\n&nbsp; &nbsp; Top = 8\n&nbsp; &nbsp; Width = 75\n&nbsp; &nbsp; Height = 25\n&nbsp; &nbsp; Caption = 'Button1'\n&nbsp; &nbsp; TabOrder = 0\n&nbsp; &nbsp; OnClick = Button1Click\n&nbsp; end\n&nbsp; object WebBrowser1: TWebBrowser\n&nbsp; &nbsp; Left = 8\n&nbsp; &nbsp; Top = 39\n&nbsp; &nbsp; Width = 619\n&nbsp; &nbsp; Height = 252\n&nbsp; &nbsp; Anchors = [akLeft, akTop, akRight, akBottom]\n&nbsp; &nbsp; TabOrder = 1\n&nbsp; &nbsp; ControlData = {\n&nbsp; &nbsp; &nbsp; 4C000000FA3F00000C1A00000000000000000000000000000000000000000000\n&nbsp; &nbsp; &nbsp; 000000004C000000000000000000000001000000E0D057007335CF11AE690800\n&nbsp; &nbsp; &nbsp; 2B2E126208000000000000004C0000000114020000000000C000000000000046\n&nbsp; &nbsp; &nbsp; 8000000000000000000000000000000000000000000000000000000000000000\n&nbsp; &nbsp; &nbsp; 00000000000000000100000000000000000000000000000000000000}\n&nbsp; end\nend<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Merhaba, Bu yaz\u0131m\u0131zda TWebBrowser nesnesinde do\u011frudan HTML kodlar\u0131n\u0131 nas\u0131l \u00e7al\u0131\u015ft\u0131raca\u011f\u0131m\u0131z\u0131, bir resmi, foto\u011fraf\u0131 disk i\u015flemlerini kullanmadan do\u011frudan nas\u0131l HTML koduna g\u00f6mebilece\u011fimizi, HTML5 ile birlikte gelen baz\u0131 yenilikleri nas\u0131l kullanabilece\u011fimizi, bu \u00e7er\u00e7evede bir vekt\u00f6r grafi\u011fi nas\u0131l olu\u015fturabilece\u011fimizi inceleyece\u011fiz. T\u00fcm bunlar\u0131 yapabilmek i\u00e7in \u00f6nce TWebBrowser nesnesinde do\u011frudan nas\u0131l HTML kodlar\u0131 \u00e7al\u0131\u015ft\u0131rabilece\u011fimizin alt yap\u0131s\u0131n\u0131 kurmay\u0131 ve IE&#8217;nin HTML5 anlar hale nas\u0131l getirilece\u011fi gibi sorunlar\u0131 nas\u0131l a\u015fabilece\u011fimize bakaca\u011f\u0131z.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[4,18,11,19],"class_list":["post-158","post","type-post","status-publish","format-standard","hentry","category-blog","tag-delphi","tag-html5","tag-programlama","tag-twebbrowser"],"_links":{"self":[{"href":"http:\/\/www.potansif.com\/index.php?rest_route=\/wp\/v2\/posts\/158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.potansif.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.potansif.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.potansif.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.potansif.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=158"}],"version-history":[{"count":1,"href":"http:\/\/www.potansif.com\/index.php?rest_route=\/wp\/v2\/posts\/158\/revisions"}],"predecessor-version":[{"id":159,"href":"http:\/\/www.potansif.com\/index.php?rest_route=\/wp\/v2\/posts\/158\/revisions\/159"}],"wp:attachment":[{"href":"http:\/\/www.potansif.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.potansif.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=158"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.potansif.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}