<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Codality &#187; Delphi</title>
	<atom:link href="http://blog.najmanowicz.com/category/software-development/delphi/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.najmanowicz.com</link>
	<description>Code and Effect - solving problem with just enough amount of code - by Adam Najmanowicz</description>
	<lastBuildDate>Mon, 23 Jan 2012 16:06:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Blog Navigator Professional posts again</title>
		<link>http://blog.najmanowicz.com/2005/02/22/blog-navigator-professional-posts-again-by-adam-najmanowicz/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=blog-navigator-professional-posts-again-by-adam-najmanowicz</link>
		<comments>http://blog.najmanowicz.com/2005/02/22/blog-navigator-professional-posts-again-by-adam-najmanowicz/#comments</comments>
		<pubDate>Tue, 22 Feb 2005 07:15:09 +0000</pubDate>
		<dc:creator>Adam Najmanowicz</dc:creator>
				<category><![CDATA[Blog Navigator]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web applications]]></category>

		<guid isPermaLink="false">http://blog.najmanowicz.com/2005/02/22/blog-navigator-professional-posts-again-by-adam-najmanowicz/</guid>
		<description><![CDATA[Security versus compatibility and functionality. Is removing features a new course for Microsoft? Originally posted on JoeUser.com Last week it has been brought to my attention that our Blog Navigator can no longer post web articles. Alas, this was only a symptom of a much worse disease, but first things first&#8230; This month in a [...]]]></description>
			<content:encoded><![CDATA[<h3>Security versus compatibility and functionality. Is removing features a  new course for Microsoft?</h3>
<p><a title="Originally posted on another site" href="http://adam.joeuser.com/articles.asp?AID=66022">Originally posted on JoeUser.com</a></p>
<p><P>Last week it has been brought to my attention that our <A href="http://www.blognavigator.com/">Blog Navigator</A> can no longer post web articles. Alas, this was only a symptom of a much worse disease, but first things first&#8230; </P><br />
<P>This month in a noble effort of making the Windows platform more secure for us and our (perhaps future) kids ;) Microsoft rolled out <A href="http://www.microsoft.com/security/bulletins/200502_windows.mspx">a new set of updates</A>, among which is this one innocently called <A href="http://www.microsoft.com/technet/security/bulletin/MS05-013.mspx">MS05-013</A> and located in Microsoft Knowledge Base under a mysterious <A href="http://www.microsoft.com/technet/security/bulletin/ms05-013.mspx">KB891781</A>.</P><br />
<P>You will find more about the update and the horror it caused among the programmers using the control affected by the update on usenet, posts as <A href="http://groups-beta.google.com/group/microsoft.public.inetsdk.programming.dhtml_editing/browse_thread/thread/c4953436aaa87d77/b2b6908f0036fb5f#b2b6908f0036fb5fthe">this</A> and <A href="http://groups-beta.google.com/group/microsoft.public.inetsdk.programming.dhtml_editing/browse_thread/thread/d6d82ab744dadc96/df34c30116dd2c48#df34c30116dd2c48">this</A>&nbsp;are only small sample of the damage. It seems that MS broke quite a few programs while making us more safe.</P><br />
<P>The effect, saying it bluntly is: <EM><STRONG><FONT color=#ff0000>IDHTMLEdit has been made useless</FONT></STRONG></EM> and <A href="http://www.blognavigator.com/">Blog Navigator</A> fallen prey to that change.</P><br />
<P>Since <A href="http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaredcom/html/cncpt.asp">IDHTMLEdit</A> is simply a wrapper around <A href="http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/reference.asp">MSHTML</A> editor, I&#8217;ve examined quite a few approaches and some existing libraries, to fix the issue as fast and with as little modifications to the existing code as possible. After a day of hunting around and testing the existing approaches I&#8217;ve decided that&nbsp;if I want to retain the control over my code and keep it at a reasonable size, I need to do it myself.</P><br />
<P>Below is my simplistic (and working) approach to migrating from <A href="http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaredcom/html/cncpt.asp">DHTML Editing Component</A> to <A href="http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/reference.asp">MSHTML</A> editor (for Delphi programmers).</P><br />
<OL><br />
<LI>I use a <A href="http://www.euromind.com/iedelphi/embeddedwb.htm">TEmbeddedWB</A>&nbsp;as the web browser control wrapper as it offers quite a bit additional functionality. I&#8217;m assuming you use that instead of the TWebbrowser as well. If you&#8217;re not, it&#8217;a not a big problem to extract the functionalty you will need here.</LI><br />
<LI>In the DhtmlEdit you operate on the DOM structure and that&#8217;s the interface the control does not allow you to access any loger and the change thaat makes it useless. The TWebBrowser offers a Document <A href="http://msdn.microsoft.com/library/en-us/automat/htm/chap5_78v9.asp">IDispatch</A> which you can cast on <A href="http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/ifaces/document2/document2.asp">IHTMLDocument2</A>. This is exactly the structure you were working on before.</LI><br />
<LI>Now the browser control itself does not offer the ExecCommand(&#8230;) functionality. but not all is lost. when you get to the <A href="http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/ifaces/document2/document2.asp">IHTMLDocument2</A> interface as described before, you can pretty much do anythng you were doing before by calling its <A href="http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/document2/execcommand.asp">execCommand</A>.</LI><br />
<LI>You can also pull ann the&nbsp;formatting data from it by querrying it with its:&nbsp;<A href="http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/document2/querycommandenabled.asp">queryCommandEnabled</A>, <A href="http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/document2/execcommand.asp">execCommand</A>, <A href="http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/document2/querycommandindeterm.asp">queryCommandIndeterm</A>, <A href="http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/document2/querycommandstate.asp">queryCommandState</A>, <A href="http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/document2/querycommandsupported.asp">queryCommandSupported</A>, <A href="http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/document2/querycommandtext.asp">queryCommandText</A>&nbsp;and <A href="http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/document2/querycommandvalue.asp">queryCommandValue</A>&nbsp;methods.</LI><br />
<LI>Now the problem is that IDHTMLEdit used numeric values while the Document requires you to use strings. The simplest method is to use a translating table which is what&nbsp;I did:</LI></OL><br />
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><PRE><STRONG>type</STRONG><BR>&nbsp; TMSHtmlCommandTranslation = <STRONG>array</STRONG> [DECMD_BOLD .. DECMD_PROPERTIES] <STRONG>of </STRONG>WideString;</PRE><PRE><STRONG>const</STRONG><BR>&nbsp; MSHtmlCommandTranslation : TMSHtmlCommandTranslation = (<BR>&nbsp; <FONT color=#0000ff>&#8216;Bold&#8217;</FONT><FONT color=#000000>,</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DECMD_BOLD = $00001388;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //<BR>&nbsp; <FONT color=#0000ff>&#8216;Copy&#8217;</FONT><FONT color=#000000>,</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DECMD_COPY = $0000138A;<BR>&nbsp; <FONT color=#0000ff>&#8216;Cut&#8217;</FONT><FONT color=#000000>,</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DECMD_CUT = $0000138B;<BR>&nbsp; <FONT color=#0000ff>&#8216;Delete&#8217;</FONT><FONT color=#000000>,</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_DELETE = $0000138C;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_DELETECELLS = $0000138D;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_DELETECOLS = $0000138E;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_DELETEROWS = $0000138F;<BR>&nbsp; <FONT color=#0000ff>&#8216;Find&#8217;</FONT><FONT color=#000000>,</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_FINDTEXT = $00001390;<BR>&nbsp; <FONT color=#0000ff>&#8216;FontName&#8217;</FONT><FONT color=#000000>,</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_FONT = $00001391;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_GETBACKCOLOR = $00001392;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_GETBLOCKFMT = $00001393;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_GETBLOCKFMTNAMES = $00001394;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_GETFONTNAME = $00001395;<BR>&nbsp; <FONT color=#0000ff>&#8216;FontSize&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_GETFONTSIZE = $00001396;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_GETFORECOLOR = $00001397;<BR>&nbsp; <FONT color=#0000ff>&#8216;CreateLink&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_HYPERLINK = $00001398;<BR>&nbsp; <FONT color=#0000ff>&#8216;InsertImage&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_IMAGE = $00001399;<BR>&nbsp; <FONT color=#0000ff>&#8216;Indent&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_INDENT = $0000139A;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_INSERTCELL = $0000139B;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_INSERTCOL = $0000139C;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_INSERTROW = $0000139D;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT><FONT color=#000000>,</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_INSERTTABLE = $0000139E;<BR>&nbsp; <FONT color=#0000ff>&#8216;Italic&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_ITALIC = $0000139F;<BR>&nbsp; <FONT color=#0000ff>&#8216;JustifyCenter&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_JUSTIFYCENTER = $000013A0;<BR>&nbsp; <FONT color=#0000ff>&#8216;JustifyLeft&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_JUSTIFYLEFT = $000013A1;<BR>&nbsp; <FONT color=#0000ff>&#8216;JustifyRight&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_JUSTIFYRIGHT = $000013A2;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT><FONT color=#000000>,</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_LOCK_ELEMENT = $000013A3;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT><STRONG>,</STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_MAKE_ABSOLUTE = $000013A4;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_MERGECELLS = $000013A5;<BR>&nbsp; <FONT color=#0000ff>&#8216;InsertOrderedList&#8217;</FONT>,  //DDECMD_ORDERLIST = $000013A6;<BR>&nbsp; <FONT color=#0000ff>&#8216;Outdent&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_OUTDENT = $000013A7;<BR>&nbsp; <FONT color=#0000ff>&#8216;Paste&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_PASTE = $000013A8;<BR>&nbsp; <FONT color=#0000ff>&#8216;Redo&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_REDO = $000013A9;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_REMOVEFORMAT = $000013AA;<BR>&nbsp; <FONT color=#0000ff>&#8216;SelectAll&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_SELECTALL = $000013AB;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_SEND_BACKWARD = $000013AC;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_BRING_FORWARD = $000013AD;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_SEND_BELOW_TEXT = $000013AE;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_BRING_ABOVE_TEXT = $000013AF;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_SEND_TO_BACK = $000013B0;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_BRING_TO_FRONT = $000013B1;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_SETBACKCOLOR = $000013B2;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_SETBLOCKFMT = $000013B3;<BR>&nbsp; <FONT color=#0000ff>&#8216;FontName&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_SETFONTNAME = $000013B4;<BR>&nbsp; <FONT color=#0000ff>&#8216;FontSize&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_SETFONTSIZE = $000013B5;<BR>&nbsp; <FONT color=#0000ff>&#8216;ForeColor&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_SETFORECOLOR = $000013B6;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_SPLITCELL = $000013B7;<BR>&nbsp; <FONT color=#0000ff>&#8216;Underline&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_UNDERLINE = $000013B8;<BR>&nbsp; <FONT color=#0000ff>&#8216;Undo&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_UNDO = $000013B9;<BR>&nbsp; <FONT color=#0000ff>&#8216;Unlink&#8217;</FONT>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DDECMD_UNLINK = $000013BA;<BR>&nbsp; <FONT color=#0000ff>&#8216;InsertUnorderedList</FONT>&#8216;,//DDECMD_UNORDERLIST = $000013BB;<BR>&nbsp; <FONT color=#0000ff>&#8221;</FONT>);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //DECMD_PROPERTIES = $000013BC;</PRE></BLOCKQUOTE><br />
<P>I store the command values as the controls Tags so now instead of calling:</P><br />
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><PRE dir=ltr>DHTMLEdit.ExecCommand(TControl(Sender).Tag,OLECMDEXECOPT_DODEFAULT);</PRE></BLOCKQUOTE><br />
<P>I&nbsp;simply call:</P><br />
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><PRE dir=ltr>FDocument.execCommand(<FONT color=#ff0000>MSHtmlCommandTranslation</FONT>[TControl(Sender).Tag],True,variant)</PRE></BLOCKQUOTE><br />
<P>where the FDocument is the <A href="http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/ifaces/document2/document2.asp">IHTMLDocument2</A>&nbsp;DOM document I extracted from the TWebBrowser for the sake of not having to cast it each time I use it. and instead of:</P><br />
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><PRE>DHTMLEdit.QueryStatus(TControl(Sender).Tag);</PRE></BLOCKQUOTE><br />
<P>I can now use:</P><br />
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><PRE>&nbsp;FDocument.queryCommandValue(<FONT color=#ff0000>MSHtmlCommandTranslation</FONT>[TControl(Sender).Tag]);<BR>&nbsp;FDocument.queryCommandEnabled(<FONT color=#ff0000>MSHtmlCommandTranslation</FONT>[TControl(Sender).Tag]);</PRE></BLOCKQUOTE><br />
<P>this allowed me to migrate away from <A href="http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaredcom/html/cncpt.asp">DHTML Editing Component</A> within one day after shunning all other options).</P><br />
<P>One thing that was pretty indispensible for <A href="http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaredcom/html/cncpt.asp">DHTML Editing Component</A> was that it called me back evary time a blok formatting was changed, it had this<FONT color=#000000> useful <EM>OnDisplayChanged</EM> event which was summoned every time the&nbsp;UI needed updating. That&#8217;s where <A href="http://www.euromind.com/iedelphi/embeddedwb.htm">TEmbeddedWB</A>&nbsp;comes handy it implements a </FONT></P><PRE>function UpdateUI: HRESULT; stdcall;</PRE><br />
<P><FONT color=#000000>which than triggers the <EM>OnUpdateUI</EM> event, which for our needs does exactly the save what the <EM>OnDisplayChanged</EM> event did. so you can simply call your previous OnDisplayChanged event with the numerical querries remapped to strings and&#8230; with minimal effort you have your control fully migrated to the <A href="http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/reference.asp">MSHTML</A>&nbsp;editor.</FONT></P><br />
<P>So&#8230; this post is the first post made with the updated <A href="http://www.blognavigator.com/">Blog Navigator</A> with its poat editong brought back to normal functionality.</P></p>
<img src="http://blog.najmanowicz.com/?ak_action=api_record_view&id=28&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.najmanowicz.com/2005/02/22/blog-navigator-professional-posts-again-by-adam-najmanowicz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

