<?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>EvoTalk &#187; ico</title>
	<atom:link href="http://evotalk.net/blog/tag/ico/feed" rel="self" type="application/rss+xml" />
	<link>http://evotalk.net/blog</link>
	<description></description>
	<lastBuildDate>Mon, 07 Jun 2010 03:01:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Get Icon by File Type</title>
		<link>http://evotalk.net/blog/2008/12/get-icon-by-file-type.html</link>
		<comments>http://evotalk.net/blog/2008/12/get-icon-by-file-type.html#comments</comments>
		<pubDate>Tue, 02 Dec 2008 06:47:15 +0000</pubDate>
		<dc:creator>asd</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Code Snippet]]></category>
		<category><![CDATA[程式設計]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[ico]]></category>

		<guid isPermaLink="false">http://evotalk.net/blog/?p=452</guid>
		<description><![CDATA[根據檔案的副檔名，取得 icon 圖案
view plain

C++:




// 傳入的 FileName 可為 &#34;.doc&#34; 、&#34;.pdf&#34;、&#34;.rar&#34; ....


void __fastcall TForm1::GetIcon&#40;AnsiString FileName&#41;


&#123;


   SHFILEINFO sfi;


   SHGetFileInfo&#40;


                  FileName.c_str&#40;&#41;,


                  FILE_ATTRIBUTE_NORMAL,


                  &#38;sfi,


                  sizeof&#40;SHFILEINFO&#41;,


                  SHGFI_ICON


                &#41;;


   TIcon* picon = [...]]]></description>
			<content:encoded><![CDATA[<p>根據檔案的副檔名，取得 icon 圖案</p>
<div class="igBar"><span id="lcpp-2"><a href="#" onclick="javascript:showCodeTxt('cpp-2'); return false;">view plain</a></span></div>
<div class="shadow">
<div class="syntax_hilite"><span class="langName">C++:</span>
<div id="cpp-2">
<div class="cpp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff0000;">// 傳入的 FileName 可為 &quot;.doc&quot; 、&quot;.pdf&quot;、&quot;.rar&quot; ....</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">void</span> __fastcall TForm1::<span style="color: #00eeff;">GetIcon</span><span style="color: #000000;">&#40;</span>AnsiString FileName<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">   SHFILEINFO sfi;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">   SHGetFileInfo<span style="color: #000000;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                  FileName.<span style="color: #00eeff;">c_str</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                  FILE_ATTRIBUTE_NORMAL,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                  &amp;sfi,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                  <span style="color: #0000dd;">sizeof</span><span style="color: #000000;">&#40;</span>SHFILEINFO<span style="color: #000000;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                  SHGFI_ICON</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                <span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">   TIcon* picon = <span style="color: #0000dd;">new</span> TIcon<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">   picon-&gt;Handle = sfi.<span style="color: #00eeff;">hIcon</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">   Image1-&gt;Canvas-&gt;Pen-&gt;Color = clWhite;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">   Image1-&gt;Canvas-&gt;Brush-&gt;Color = clWhite;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">   Image1-&gt;Canvas-&gt;Rectangle<span style="color: #000000;">&#40;</span> <span style="color: #0000dd;color:#800000;">0</span>, <span style="color: #0000dd;color:#800000;">0</span>, <span style="color: #0000dd;color:#800000;">32</span>, <span style="color: #0000dd;color:#800000;">32</span> <span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">   Image1-&gt;Canvas-&gt;Draw<span style="color: #000000;">&#40;</span> <span style="color: #0000dd;color:#800000;">0</span>, <span style="color: #0000dd;color:#800000;">0</span>, picon <span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">   DestroyIcon<span style="color: #000000;">&#40;</span> sfi.<span style="color: #00eeff;">hIcon</span> <span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">   <span style="color: #0000dd;">delete</span> picon;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://evotalk.net/blog/2008/12/get-icon-by-file-type.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
