<?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>CCRDude&#039;s dev blog</title>
	<atom:link href="http://www.ccrdude.net/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ccrdude.net</link>
	<description>Daily stuff not frequently posted a software developer finds out or rants about.</description>
	<lastBuildDate>Wed, 14 Dec 2011 07:45:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>&#8220;Transparent&#8221; TEdit on TTabSheet</title>
		<link>http://www.ccrdude.net/archives/250</link>
		<comments>http://www.ccrdude.net/archives/250#comments</comments>
		<pubDate>Wed, 14 Dec 2011 07:45:26 +0000</pubDate>
		<dc:creator>CCRDude</dc:creator>
				<category><![CDATA[General Development]]></category>

		<guid isPermaLink="false">http://www.ccrdude.net/?p=250</guid>
		<description><![CDATA[From time to time, I encounter the same issue. I&#8217;ve got a TPageControl, a TTabSheet on it, and a simply TEdit that replaced a TLabel just for the purpose of the content to be copyable. BorderStyle is set to bsNone, ReadOnly to True, ad it looks just like a label on modern Windows. But as [...]]]></description>
			<content:encoded><![CDATA[<p>From time to time, I encounter the same issue. I&#8217;ve got a <code>TPageControl</code>, a <code>TTabSheet</code> on it, and a simply <code>TEdit</code> that replaced a <code>TLabel</code> just for the purpose of the content to be copyable.</p>
<p><code>BorderStyle</code> is set to <code>bsNone</code>, <code>ReadOnly</code> to <code>True</code>, ad it looks just like a label on modern Windows.</p>
<p>But as soon as you use this on a Windows that uses the <em>classic style</em> (the one that looks a bit like Windows 2000), the tabsheets do no longer have a white background, but a <em>clBtnFace</em> one, and since <code>TEdit</code> is not really tranparent, they look out of place suddenly.</p>
<p>I <a href="http://www.delphipraxis.net/dp_search.php?do=keywordsearch&amp;search_keywords=transparent+tedit&amp;search_sortby=%40relevance&amp;search_resulttype=thread&amp;search_matchmode=0">searched the Delphi-PRAXiS forum</a> for solutions, and found a TTransEdit component there &#8211; but that one, I had already discarded years ago, and again didn&#8217;t solve the issue for me.</p>
<p>Annoyed by all these struggles, I went another route. I added UXTheme to the uses clause, and simply updated the color based on theming.</p>
<p><code>procedure TformNTProcess.FormCreate(Sender: TObject);<br />
begin<br />
&nbsp;&nbsp;&nbsp;FProcessImageName := '';<br />
&nbsp;&nbsp;&nbsp;FTerminated := false;<br />
&nbsp;&nbsp;&nbsp;if not UseThemes then begin<br />
&nbsp;&nbsp;&nbsp;editImageName.Color := clBtnFace;<br />
&nbsp;&nbsp;&nbsp;editImageNameNT.Color := clBtnFace;<br />
&nbsp;&nbsp;&nbsp;end;<br />
end;</code></p>
<p>So far, this works much better and reliable than replacing all TEdit with TTransEdit. Granted, it does not provide transparency for background images, but it solves the TTabSheet theming issue better than a nonperfect transparency solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ccrdude.net/archives/250/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Certified Delphi Developer</title>
		<link>http://www.ccrdude.net/archives/242</link>
		<comments>http://www.ccrdude.net/archives/242#comments</comments>
		<pubDate>Fri, 28 Oct 2011 09:50:43 +0000</pubDate>
		<dc:creator>CCRDude</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[General Development]]></category>

		<guid isPermaLink="false">http://www.ccrdude.net/?p=242</guid>
		<description><![CDATA[When upgrading to Delphi XE, or maybe some weeks later, I noticed the offer of a free certification that came with buying the upgrade. So I visited the Delphi Developer Certification website, read the study guide, and had a split opinion. I&#8217;m a low level coder. If I use databases, I use SQLite or WySQL [...]]]></description>
			<content:encoded><![CDATA[<p>When upgrading to Delphi XE, or maybe some weeks later, I noticed the offer of a free certification that came with buying the upgrade. So I visited the <a href="http://www.embarcadero.com/certification/delphi-developer">Delphi Developer Certification</a> website, read the study guide, and had a split opinion.</p>
<p>I&#8217;m a low level coder. If I use databases, I use SQLite or WySQL libraries directly, without the overhead of Delphis database components. Some questions deal with this. Guessing how many areas there are and that you need only 80% of correct answers to pass, I decided I could have some lack of knowledge here.</p>
<p>Another area are generics and anonymous methods. Before upgrading from Delphi 2006, I never cared about them, so I had to learn. Not that difficult, I reserved half a day and knew everything I needed.</p>
<p>Meanwhile, time has passed, since work is more fun than exams, and I requested the serial for the exam the last day possible, and took the exam again the last possible day. Wouldn&#8217;t have needed to, since answering the majority of questions took 15 minutes, with another 15 minutes spent on 5 questions I was unsure about.</p>
<p>If you also have a free go at the test, I can only recommend taking it. Even if you don&#8217;t prepare, you won&#8217;t loose anything, but if you spend some time on preparation and have a few years of background, I think it&#8217;s easy to pass.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ccrdude.net/archives/242/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TrayIcons in the Window 7 registry</title>
		<link>http://www.ccrdude.net/archives/183</link>
		<comments>http://www.ccrdude.net/archives/183#comments</comments>
		<pubDate>Fri, 23 Sep 2011 07:44:46 +0000</pubDate>
		<dc:creator>CCRDude</dc:creator>
				<category><![CDATA[Delphi]]></category>

		<guid isPermaLink="false">http://www.ccrdude.net/?p=183</guid>
		<description><![CDATA[In this post at the German speaking Delphi-PRAXiS forum, tray icon visibility on Windows 7 was discussed. While I quite like Microsofts decision to let the user decide which icons spam their desktop, I can understand the technical challenge to know how the new IconStreams registry value (at HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify\) is defined. I therefore did [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.delphipraxis.net/163161-eigenschaft-von-tray-icons-der-notification-area-ueber-die-registry-aendern-win7.html">this post</a> at the German speaking Delphi-PRAXiS forum, tray icon visibility on Windows 7 was discussed. While I quite like Microsofts decision to let the user decide which icons spam their desktop, I can understand the technical challenge to know how the new IconStreams registry value (at <em>HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify\</em>) is defined. I therefore did a bit of trial and error debugging and wrote <a href="http://www.ccrdude.net/archives/183/readiconstreams" rel="attachment wp-att-182">ReadIconStreams.dpr</a>, a small tool that reads and displays this information for the current user.</p>
<p>To sum things up, after a header of 20 bytes, we have repeated records of this type:<br />
<code>TIconStreamRecord = packed record<br />
FilenameRaw: array [0 .. 263] of WideChar;<br />
VisibilityRaw: DWord;<br />
Reserved0: array[0..3] of byte;<br />
LastVisibleTooltipRaw: array [0 .. 253] of WideChar;<br />
Reserved1: array [0 .. 591] of Byte;<br />
Reserved2: DWord;<br />
end;</code><br />
Filename and Tooltip are <a href="http://en.wikipedia.org/wiki/Rot13">Rot13</a> encoded, in a strict form (only letters are moved). Visibility is 0 to 2, with 0 being <em>Only Notifications</em>, 1 <em>Hides Icons and Notifications</em>, and 2 shows both. There&#8217;s more data in there, but that is irrelevant for this question and open for some future fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ccrdude.net/archives/183/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog updated</title>
		<link>http://www.ccrdude.net/archives/85</link>
		<comments>http://www.ccrdude.net/archives/85#comments</comments>
		<pubDate>Mon, 19 Sep 2011 14:19:54 +0000</pubDate>
		<dc:creator>CCRDude</dc:creator>
				<category><![CDATA[Administrative]]></category>

		<guid isPermaLink="false">http://www.ccrdude.net/?p=85</guid>
		<description><![CDATA[I know I didn&#8217;t write a lot here, but wanted to update anyway, to see the blog software in action, and because usually when I think about blogging, I found the old blogger.com thing too unflexible. Which means I hope to update this more frequently. Mostly about Delphi stuff. the Like bugs in the TListView [...]]]></description>
			<content:encoded><![CDATA[<p>I know I didn&#8217;t write a lot here, but wanted to update anyway, to see the blog software in action, and because usually when I think about blogging, I found the old blogger.com thing too unflexible. Which means I hope to update this more frequently. Mostly about Delphi stuff. the Like bugs in the TListView implementation I recently reported, but also about stuff I wrote in Delphi that I want to publish somewhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ccrdude.net/archives/85/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3DxWare 10 beta driver is available</title>
		<link>http://www.ccrdude.net/archives/45</link>
		<comments>http://www.ccrdude.net/archives/45#comments</comments>
		<pubDate>Thu, 31 Mar 2011 13:25:00 +0000</pubDate>
		<dc:creator>CCRDude</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Universal Cosmonaut]]></category>

		<guid isPermaLink="false">http://www.ccrdude.net/?p=45</guid>
		<description><![CDATA[In my last post to this blog, I announced that Universal Cosmonaut was frozen because 3DConnexion announced a generic driver. This one has finally arrived in beta state. I got notice of this due to subscribing to the announcement thread on their forum, and went ahead to download and try it. So far, the new [...]]]></description>
			<content:encoded><![CDATA[<p>In my last post to this blog, I announced that Universal Cosmonaut was frozen because 3DConnexion announced a generic driver. This one has finally <a href="http://www.3dconnexion.com/forum/viewtopic.php?thttp://www.blogger.com/img/blank.gif=4070">arrived</a> in beta state.</p>
<p>I got notice of this due to subscribing to the <a href="http://www.3dconnexion.com/forum/viewtopic.php?p=21337#21337">announcement thread</a> on their forum, and went ahead to download and try it.</p>
<p>So far, the new driver seems to emulate the mouse well &#8211; scrolling in Explorer and Firefox for example works out of the box.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ccrdude.net/archives/45/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Universal Cosmonaut frozen</title>
		<link>http://www.ccrdude.net/archives/44</link>
		<comments>http://www.ccrdude.net/archives/44#comments</comments>
		<pubDate>Fri, 08 Oct 2010 14:38:00 +0000</pubDate>
		<dc:creator>CCRDude</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Universal Cosmonaut]]></category>

		<guid isPermaLink="false">http://www.ccrdude.net/?p=44</guid>
		<description><![CDATA[After playing around with the code to get it to run on my Windows 7 (changing execution level in manifest and all that), I browsed the 3DConnexion forums (see fifth post) and found that the next generation of official drivers will support generic mapping. I&#8217;m therefore freezing work on this. Since it&#8217;s open source, contributions [...]]]></description>
			<content:encoded><![CDATA[<p>After playing around with the code to get it to run on my Windows 7 (changing execution level in manifest and all that), I browsed the <a href="http://www.3dconnexion.com/forum/viewtopic.php?t=3761&amp;start=0&amp;postdays=0&amp;postorder=asc&amp;amp">3DConnexion forums</a> (see fifth post) and found that the next generation of official drivers will support generic mapping. I&#8217;m therefore freezing work on this. Since it&#8217;s open source, contributions are still welcome of course.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ccrdude.net/archives/44/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Old and new Delphi bugs #4: invalid PE header makes security applications impossible</title>
		<link>http://www.ccrdude.net/archives/43</link>
		<comments>http://www.ccrdude.net/archives/43#comments</comments>
		<pubDate>Fri, 08 Oct 2010 13:34:00 +0000</pubDate>
		<dc:creator>CCRDude</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Delphi Bugs]]></category>

		<guid isPermaLink="false">http://www.ccrdude.net/?p=43</guid>
		<description><![CDATA[As you might be aware, I&#8217;m coding security software. For security software, Microsoft has special requirements. Code-signing files on Vista with the Vista SDK (and of course Win7) has a new command line parameter available: /ph generates page hashes for executables. In combination with a IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY (0&#215;0080) flag in the Characteristics field of the PE [...]]]></description>
			<content:encoded><![CDATA[<p>As you might be aware, I&#8217;m coding security software. For security software, Microsoft has special requirements.</p>
<p><span id="MainContentUserControl_ctl00_DescriptionLabel">Code-signing files on Vista with the Vista SDK (and of course Win7) has a new command line parameter available: /ph generates page hashes for executables.</span></p>
<p>In combination with a <span style="font-family: courier new;">IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY (0&#215;0080)</span> flag in the Characteristics field of the PE Optional Header, this allows some more security.</p>
<p>After researching bugs for a long time without success, Microsoft finally helped me pinpoint the problem &#8211; <span id="MainContentUserControl_ctl00_DescriptionLabel">the section table of files compiled with Delphi, including 2009, lists sections with a physical size of zero but a non-zero address, which causes the failure. A workaround is to manually patch the section table of Delphi executables here.</span></p>
<p>I&#8217;ve got a small tool that does this, but had hoped for Delphi to fix this. Because Microsoft is clear on the specifications of the PE format, <span>the PointerToRawData for empty sections to be exact:<br />
</span></p>
<blockquote style="font-style: italic;"><p>&#8220;When a section contains only uninitialized data, this field should be zero.&#8221;</p></blockquote>
<p>So why do you create files where this is not so, Embarcadero?</p>
<p>More information:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/ms680339.aspx">MSDN: PE Optional Header</a></li>
<li><a href="http://www.microsoft.com/whdc/system/platform/firmware/PECOFFdwn.mspx">Microsoft: PE format documentation</a></li>
<li><a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=72147">Embarcadero QualityCentral issue 72147</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ccrdude.net/archives/43/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Old and new Delphi bugs #3: Windows Error Reporting</title>
		<link>http://www.ccrdude.net/archives/42</link>
		<comments>http://www.ccrdude.net/archives/42#comments</comments>
		<pubDate>Fri, 08 Oct 2010 10:37:00 +0000</pubDate>
		<dc:creator>CCRDude</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Delphi Bugs]]></category>
		<category><![CDATA[Delphi XE]]></category>

		<guid isPermaLink="false">http://www.ccrdude.net/?p=42</guid>
		<description><![CDATA[While looking at the requirements for the Vista logo programs years ago, I encountered a useful requirement: applications should, when unhandled exceptions occur, crash to Windows Error Reporting (WER), so that a report can be send to Microsoft, where developers can make information about updates with fixes available. This means that in an ideal case, [...]]]></description>
			<content:encoded><![CDATA[<p>While looking at the requirements for the Vista logo programs years ago, I encountered a useful requirement: applications should, when unhandled exceptions occur, crash to Windows Error Reporting (WER), so that a report can be send to Microsoft, where developers can make information about updates with fixes available.</p>
<p>This means that in an ideal case, an application crashes, WER looks up the error and informs the user that he should update to version X.Y to avoid this problem in the future. And if the bug is yet unfixed, at least the developer receives information about in (from WinQual) and can deal with it.</p>
<p>This basically means that at least for the Release builds, Delphi should simply call WER. I reported this as a bug in 2007 (since not doing so makes it impossible to get Certified for Vista), but so far, the issue was opened, but otherwise ignored.</p>
<p>You can work around this by adding your own handler for unexpected exceptions and calling ReportFault from there, but since this is standard that should be part of all applications, I would expect this to be part of the RTL.</p>
<p>More information:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/ms679274.aspx">MSDN: AddVectoredExceptionHandler</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/library/ms681419.aspx">MSDN: VectoredHandler</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/bb513615%28VS.85%29.aspx">MSDN: ReportFault</a></li>
<li><a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=39132">Embarcadero QualityCentral issue 39132</a></li>
</ul>
<p>To add one downside of WER: I like <a href="http://madshi.net/">madException</a> a lot for error reporting in test versions, where data won&#8217;t have to be passed to Microsoft. But then, test versions don#t need to be certified, so using madExcept for DEBUG and WER for RELEASE builds is my way to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ccrdude.net/archives/42/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Old and new Delphi bugs #2: Delphi XE and Windows Vista/7</title>
		<link>http://www.ccrdude.net/archives/41</link>
		<comments>http://www.ccrdude.net/archives/41#comments</comments>
		<pubDate>Fri, 08 Oct 2010 10:00:00 +0000</pubDate>
		<dc:creator>CCRDude</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Delphi Bugs]]></category>
		<category><![CDATA[Delphi XE]]></category>

		<guid isPermaLink="false">http://www.ccrdude.net/?p=41</guid>
		<description><![CDATA[I&#8217;ve ranted about this during the Highlander field test, and I&#8217;m still doing it I guess. To say it upfront: Delphi XE is not fully compatible with Windows Vista and Windows 7. Why that? By compatibility, I refer to Microsofts standards. If I use some tools to create applications for Windows Vista or Windows 7, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve ranted about this during the Highlander field test, and I&#8217;m still doing it I guess. To say it upfront: Delphi XE is not <span style="font-style: italic;">fully</span> compatible with Windows Vista and Windows 7.</p>
<p>Why that? By compatibility, I refer to Microsofts standards. If I use some tools to create applications for Windows Vista or Windows 7, I expect that my created applications could at least pass Microsofts certification process.</p>
<p>Starting with Windows Vista, Microsoft has introduced UAC, which makes certain settings within the manifest file mandatory (necessary for the certification process). And next to certification requirements, MSDN says:</p>
<blockquote style="font-style: italic;"><p>&#8220;In future releases, the only way to run an application elevated will be to have a signed application manifest that identifies the privilege level that the application needs.&#8221;</p></blockquote>
<p>Which means it will be mandatory for applications that need to elevate (need administration rights).</p>
<p>Now, you can create a manifest file yourself and embed it within the application, so this is not really a total showstopper, but Delphi still has just a simple checkbox labeled <span style="font-style: italic;">&#8220;Enable runtime themes&#8221;</span> that would add an imcompatible manifest. Sad, isn&#8217;t it?</p>
<p>More information:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/bb756929.aspx">MSDN: Create and Embed an Application Manifest</a></li>
<li><a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=37448">Embarcadero QualityCentral report 37448</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ccrdude.net/archives/41/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mirkes HexEditor (TMPHexEditor) now compatible with Dephi XE!</title>
		<link>http://www.ccrdude.net/archives/40</link>
		<comments>http://www.ccrdude.net/archives/40#comments</comments>
		<pubDate>Fri, 08 Oct 2010 09:53:00 +0000</pubDate>
		<dc:creator>CCRDude</dc:creator>
				<category><![CDATA[Delphi Code Revival]]></category>
		<category><![CDATA[Delphi XE]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[LaunchPad]]></category>

		<guid isPermaLink="false">http://www.ccrdude.net/?p=40</guid>
		<description><![CDATA[As promised in an earlier blog post, I updated Mirkes TMPHexEditor component to be compatible with Delphi XE (and thus also Delphi 2009 I hope). I also finally uploaded the source code to LaunchPad, the open source platform I use, so now my previous updates to the code, including for example OwnerData as well as [...]]]></description>
			<content:encoded><![CDATA[<p>As promised in an earlier blog post, I updated Mirkes TMPHexEditor component to be compatible with Delphi XE (and thus also Delphi 2009 I hope).</p>
<p>I also finally uploaded the source code to LaunchPad, the open source platform I use, so now my previous updates to the code, including for example OwnerData as well as section hightlighting. The printer dialogs from examples have also been added into reusable units, and the prefix changes from MP to dcr, since I plan to add more legacy forsaken code into this package.</p>
<p>More information:</p>
<ul>
<li><a href="https://launchpad.net/dcr">Delphi Code Revival @ LaunchPad</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ccrdude.net/archives/40/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

