<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>VisualC++ Tips</title>
	<atom:link href="http://afsalm.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://afsalm.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Thu, 04 Sep 2008 12:06:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='afsalm.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>VisualC++ Tips</title>
		<link>http://afsalm.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://afsalm.wordpress.com/osd.xml" title="VisualC++ Tips" />
	<atom:link rel='hub' href='http://afsalm.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How to set focus to a control in the dialog startup</title>
		<link>http://afsalm.wordpress.com/2008/09/04/how-to-set-focus-to-a-control-when-a-dialog-startup/</link>
		<comments>http://afsalm.wordpress.com/2008/09/04/how-to-set-focus-to-a-control-when-a-dialog-startup/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 12:00:36 +0000</pubDate>
		<dc:creator>afsalm</dc:creator>
				<category><![CDATA[VC++]]></category>
		<category><![CDATA[Set Focus]]></category>
		<category><![CDATA[WM_NEXTDLGCTL]]></category>

		<guid isPermaLink="false">http://afsalm.wordpress.com/?p=24</guid>
		<description><![CDATA[Setting focus to a dialog control is more than just call SetFocus. Normally, the focus is set to a control which was higher in z-order. But we can set focus in two ways. Call SetFocus() function to desired control in OnInitDialog and return FALSE. Call ::PostMessage( this-&#62;m_hWnd, WM_NEXTDLGCTL, (WPARAM)( GetDlgItem( IDC_BUTTON1 )-&#62;m_hWnd ), TRUE );  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=24&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:10pt;font-family:Verdana;">Setting focus to a dialog control is more than just call SetFocus.</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Normally, the focus is set to a control which was higher in z-order. But we can set focus in two ways.</span></p>
<ol style="margin-top:0;" type="1">
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Call SetFocus()      function to desired control in OnInitDialog and return FALSE. </span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Call ::PostMessage( this-&gt;m_hWnd, WM_NEXTDLGCTL, (WPARAM)( GetDlgItem( IDC_BUTTON1 )-&gt;m_hWnd ), TRUE );  in OnInitDialog() and return TRUE. Don&#8217;t call SendMessage instead of PostMessage.<br />
</span></li>
</ol>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/afsalm.wordpress.com/24/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/afsalm.wordpress.com/24/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/afsalm.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/afsalm.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/afsalm.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/afsalm.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/afsalm.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/afsalm.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/afsalm.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/afsalm.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/afsalm.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/afsalm.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/afsalm.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/afsalm.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/afsalm.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/afsalm.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=24&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://afsalm.wordpress.com/2008/09/04/how-to-set-focus-to-a-control-when-a-dialog-startup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e801c773370f0a59e39751eaa77f458?s=96&#38;d=identicon" medium="image">
			<media:title type="html">afsalm</media:title>
		</media:content>
	</item>
		<item>
		<title>See Assembly code generated for your source code</title>
		<link>http://afsalm.wordpress.com/2008/08/21/see-assembly-code-generated-for-your-source-code/</link>
		<comments>http://afsalm.wordpress.com/2008/08/21/see-assembly-code-generated-for-your-source-code/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 08:22:54 +0000</pubDate>
		<dc:creator>afsalm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://afsalm.wordpress.com/?p=21</guid>
		<description><![CDATA[To study internals, we often need to refer assembly code. Method to generate assembly code 1. Take “Project settings” by Alt+F7 2. Go to “C/C++&#8221; tab. 3. Select “Listing Files” from Category combo box. 4. Select “Assembly with source Code” form Listing file type combo box. 5. Recompile the project. 6. Take the debug or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=21&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To study internals, we often need to refer assembly code.</p>
<p>Method to generate assembly code<br />
1. Take “<strong>Project settings</strong>” by Alt+F7<br />
2. Go to “<strong>C/C++</strong>&#8221; tab.<br />
3. Select “<strong>Listing Files</strong>” from Category combo box.<br />
4. Select “<strong>Assembly with source Code</strong>” form Listing file type combo box.<br />
5. Recompile the project.<br />
6. Take the debug or release directory, you can see asm files</p>
<p>This can be done in another way, Just add <strong>/FAs</strong> to the “<strong>Project Options</strong>” edit box in the “<strong>C/C++</strong>” tab.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/afsalm.wordpress.com/21/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/afsalm.wordpress.com/21/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/afsalm.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/afsalm.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/afsalm.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/afsalm.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/afsalm.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/afsalm.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/afsalm.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/afsalm.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/afsalm.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/afsalm.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/afsalm.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/afsalm.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/afsalm.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/afsalm.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=21&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://afsalm.wordpress.com/2008/08/21/see-assembly-code-generated-for-your-source-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e801c773370f0a59e39751eaa77f458?s=96&#38;d=identicon" medium="image">
			<media:title type="html">afsalm</media:title>
		</media:content>
	</item>
		<item>
		<title>Difference between ::PostMessage and ::SendMessage APIs</title>
		<link>http://afsalm.wordpress.com/2008/08/21/difference-between-postmessage-and-sendmessage-apis/</link>
		<comments>http://afsalm.wordpress.com/2008/08/21/difference-between-postmessage-and-sendmessage-apis/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 06:09:59 +0000</pubDate>
		<dc:creator>afsalm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://afsalm.wordpress.com/?p=18</guid>
		<description><![CDATA[The difference between these two APIs is that the way they return control to the calling application. With SendMessage, the control doesn’t return to the calling application until the window process the message. However, PostMessage returns the control immediately after the message push to the windows message queue regardless whether the sent message has been [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=18&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">The difference between these two APIs is that the way they return control to the calling application. With <strong>SendMessage</strong>, the control doesn’t return to the calling application until the window process the message. However, <strong>PostMessage</strong> returns the control immediately after the message push to the windows message queue regardless whether the sent message has been processed or not.</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/afsalm.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/afsalm.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/afsalm.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/afsalm.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/afsalm.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/afsalm.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/afsalm.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/afsalm.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/afsalm.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/afsalm.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/afsalm.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/afsalm.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/afsalm.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/afsalm.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/afsalm.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/afsalm.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=18&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://afsalm.wordpress.com/2008/08/21/difference-between-postmessage-and-sendmessage-apis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e801c773370f0a59e39751eaa77f458?s=96&#38;d=identicon" medium="image">
			<media:title type="html">afsalm</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows API reference</title>
		<link>http://afsalm.wordpress.com/2008/08/13/windows-api-reference/</link>
		<comments>http://afsalm.wordpress.com/2008/08/13/windows-api-reference/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 09:46:31 +0000</pubDate>
		<dc:creator>afsalm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://afsalm.wordpress.com/?p=13</guid>
		<description><![CDATA[Windows API reference Windows API reference<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=13&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span class="alignleft">Windows API reference</span><span class="alignleft"> </span><a class="alignleft" title="Windows API reference" href="http://msdn.microsoft.com/en-us/library/cc433218(VS.85).aspx" target="_blank">Windows API reference</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/afsalm.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/afsalm.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/afsalm.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/afsalm.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/afsalm.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/afsalm.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/afsalm.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/afsalm.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/afsalm.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/afsalm.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/afsalm.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/afsalm.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/afsalm.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/afsalm.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/afsalm.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/afsalm.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=13&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://afsalm.wordpress.com/2008/08/13/windows-api-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e801c773370f0a59e39751eaa77f458?s=96&#38;d=identicon" medium="image">
			<media:title type="html">afsalm</media:title>
		</media:content>
	</item>
		<item>
		<title>What is the difference between UNICODE and _UNICODE</title>
		<link>http://afsalm.wordpress.com/2008/08/04/what-is-the-difference-between-unicode-and-_unicode/</link>
		<comments>http://afsalm.wordpress.com/2008/08/04/what-is-the-difference-between-unicode-and-_unicode/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 09:11:27 +0000</pubDate>
		<dc:creator>afsalm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[UNICODE and _UNICODE]]></category>

		<guid isPermaLink="false">http://afsalm.wordpress.com/?p=11</guid>
		<description><![CDATA[The purpose of the both preprocessor macros are same. UNICODE is used by windows headers and _UNICODE is used by C-Runtime/MFC headers.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=11&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The purpose of the both preprocessor macros are same.</p>
<p>UNICODE is used by windows headers and _UNICODE is used by C-Runtime/MFC headers.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/afsalm.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/afsalm.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/afsalm.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/afsalm.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/afsalm.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/afsalm.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/afsalm.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/afsalm.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/afsalm.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/afsalm.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/afsalm.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/afsalm.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/afsalm.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/afsalm.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/afsalm.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/afsalm.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=11&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://afsalm.wordpress.com/2008/08/04/what-is-the-difference-between-unicode-and-_unicode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e801c773370f0a59e39751eaa77f458?s=96&#38;d=identicon" medium="image">
			<media:title type="html">afsalm</media:title>
		</media:content>
	</item>
		<item>
		<title>CDC::DrawText</title>
		<link>http://afsalm.wordpress.com/2008/07/10/cdcdrawtext/</link>
		<comments>http://afsalm.wordpress.com/2008/07/10/cdcdrawtext/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 06:54:40 +0000</pubDate>
		<dc:creator>afsalm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[MFC]]></category>

		<guid isPermaLink="false">http://afsalm.wordpress.com/?p=10</guid>
		<description><![CDATA[The syntax int DrawText( const CString&#38; str, LPRECT lpRect, UINT nFormat ); We dont know the width and height of the rectangle where the text to display, so that the lpRect is empty Then how calculate the text area ? It is simple, Eg: CRect rcText( 0, 0, 0 ,0 ); dc.DrawText( csText, &#38;rcText, DT_CALCRECT [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=10&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The syntax</p>
<p>int DrawText( const CString&amp; str, LPRECT lpRect, UINT nFormat );</p>
<p>We dont know the width and height of the rectangle where the text to display, so that the lpRect is empty<br />
Then how calculate the text area ?</p>
<p>It is simple,</p>
<p>Eg:</p>
<p>CRect rcText( 0, 0, 0 ,0 );</p>
<p>dc.DrawText( csText, &amp;rcText, DT_CALCRECT );<br />
dc.DrawText( csText, &amp;rcText, DT_CENTER );</p>
<p>The first DrawText fills rcText with required value, ie the hight of the text, width of the text.<br />
Call next DrawText, then the text will display.</p>
<p>The return of the DrawText is the height of the text. But we also have to calculate the width of the text. So the above method is easy to use.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/afsalm.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/afsalm.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/afsalm.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/afsalm.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/afsalm.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/afsalm.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/afsalm.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/afsalm.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/afsalm.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/afsalm.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/afsalm.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/afsalm.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/afsalm.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/afsalm.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/afsalm.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/afsalm.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=10&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://afsalm.wordpress.com/2008/07/10/cdcdrawtext/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e801c773370f0a59e39751eaa77f458?s=96&#38;d=identicon" medium="image">
			<media:title type="html">afsalm</media:title>
		</media:content>
	</item>
		<item>
		<title>Get Icon of a process</title>
		<link>http://afsalm.wordpress.com/2008/07/08/get-icon-of-a-process/</link>
		<comments>http://afsalm.wordpress.com/2008/07/08/get-icon-of-a-process/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 13:18:31 +0000</pubDate>
		<dc:creator>afsalm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://afsalm.wordpress.com/?p=9</guid>
		<description><![CDATA[Use ExtractIconEx function to get icon of a process. It will return both small and large icon of the specified process. ::ExtractIconEx( szProcessName, 0, &#38;hSmallIcon, &#38;hLargeIcon, 1 ) ; You must destroy all icons extracted by ExtractIconEx by calling the DestroyIcon function.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=9&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Use ExtractIconEx function to get icon of a process. It will return both small and large icon of the specified process.</p>
<p>::ExtractIconEx( szProcessName, 0, &amp;hSmallIcon, &amp;hLargeIcon, 1 ) ;</p>
<p>You must destroy all icons extracted by ExtractIconEx by calling the DestroyIcon function.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/afsalm.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/afsalm.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/afsalm.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/afsalm.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/afsalm.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/afsalm.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/afsalm.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/afsalm.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/afsalm.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/afsalm.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/afsalm.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/afsalm.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/afsalm.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/afsalm.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/afsalm.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/afsalm.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=9&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://afsalm.wordpress.com/2008/07/08/get-icon-of-a-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e801c773370f0a59e39751eaa77f458?s=96&#38;d=identicon" medium="image">
			<media:title type="html">afsalm</media:title>
		</media:content>
	</item>
		<item>
		<title>Why this program is not crashing up?</title>
		<link>http://afsalm.wordpress.com/2008/07/07/why-this-program-is-not-crashing-up/</link>
		<comments>http://afsalm.wordpress.com/2008/07/07/why-this-program-is-not-crashing-up/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 11:02:58 +0000</pubDate>
		<dc:creator>afsalm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://afsalm.wordpress.com/?p=8</guid>
		<description><![CDATA[class Test { private: int m_Data; void Disp( int n) { int i = n + 100; cout &#60;&#60; &#8220;Data = &#8221; &#60;&#60; i; } }; int main() { Test* t = 0; t-&#62;Disp( 100 ); } What is the output of this function? Will it crash? This program outputs Data = 200 Why? Normally [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=8&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>class Test<br />
{<br />
private:</p>
<p>int m_Data;</p>
<p>void Disp( int n)<br />
{<br />
int i = n + 100;<br />
cout &lt;&lt; &#8220;Data = &#8221; &lt;&lt; i;<br />
}<br />
};</p>
<p>int main()<br />
{<br />
Test* t = 0;<br />
t-&gt;Disp( 100 );<br />
}</p>
<p>What is the output of this function? Will it crash?</p>
<p>This program outputs Data = 200 Why?<br />
Normally we think program will crash if function call with a null pointer. But if you know the internal working of member function call, it will easy to catch my words.</p>
<p>As you all know, there is only one definition of member function in memory. All the instance of the class uses this memory.<br />
t-&gt;Disp( 100 ) will replaced by compiler as Test::Disp( Test* this, int n ) ( Note that every non static member function will have &#8220;this&#8221; pointer to refer the calling object itself ).</p>
<p>Then this is null pointer and n is 100. Inside the Disp function we just manipulate data that don’t depends the class. So there is no chance for crash.</p>
<p>But if we call member data inside the Disp function, the scene will change, this-&gt;m_Data surely crash the program.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/afsalm.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/afsalm.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/afsalm.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/afsalm.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/afsalm.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/afsalm.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/afsalm.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/afsalm.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/afsalm.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/afsalm.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/afsalm.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/afsalm.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/afsalm.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/afsalm.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/afsalm.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/afsalm.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=8&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://afsalm.wordpress.com/2008/07/07/why-this-program-is-not-crashing-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e801c773370f0a59e39751eaa77f458?s=96&#38;d=identicon" medium="image">
			<media:title type="html">afsalm</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Handle</title>
		<link>http://afsalm.wordpress.com/2008/07/07/windows-handle/</link>
		<comments>http://afsalm.wordpress.com/2008/07/07/windows-handle/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 07:20:07 +0000</pubDate>
		<dc:creator>afsalm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Win32]]></category>

		<guid isPermaLink="false">http://afsalm.wordpress.com/?p=4</guid>
		<description><![CDATA[In windows OS, every resource is an &#8220;object&#8221; identified and referenced by handle of type HANDLE. In 32 bit machine, it is a 32 bit value. HANDLE is just a typedef of void pointer. This type is declared in WinNT.h as typedef PVOID HANDLE; Usually, the HANDLE is wrapped in an instance of a class. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=4&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In windows OS, every resource is an &#8220;object&#8221; identified and referenced by handle of type <strong>HANDLE</strong>.<br />
In 32 bit machine, it is a 32 bit value. HANDLE is just a typedef of void pointer.<br />
This type is declared in WinNT.h as typedef PVOID HANDLE;<br />
Usually, the HANDLE is wrapped in an instance of a class. CWnd is a good example; it contains HWND which is a handle to a window. Here CWnd brings the object oriented concept. For exapmle to show a window,</p>
<p>pWnd-&gt;ShowWindow( SW_SHOW ); this is exactly same as ::ShowWindow( pWnd-&gt;m_hWnd, SW_SHoW );</p>
<p>Kernal objects must be manipulated by HANDLES contains:<br />
files, thread, memory,events,mutexes,semaphores,pipes,processes</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/afsalm.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/afsalm.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/afsalm.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/afsalm.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/afsalm.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/afsalm.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/afsalm.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/afsalm.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/afsalm.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/afsalm.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/afsalm.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/afsalm.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/afsalm.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/afsalm.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/afsalm.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/afsalm.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=4&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://afsalm.wordpress.com/2008/07/07/windows-handle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e801c773370f0a59e39751eaa77f458?s=96&#38;d=identicon" medium="image">
			<media:title type="html">afsalm</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://afsalm.wordpress.com/2008/07/04/hello-world/</link>
		<comments>http://afsalm.wordpress.com/2008/07/04/hello-world/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 12:17:40 +0000</pubDate>
		<dc:creator>afsalm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=1&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to <a href="http://wordpress.com/">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/afsalm.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/afsalm.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/afsalm.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/afsalm.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/afsalm.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/afsalm.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/afsalm.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/afsalm.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/afsalm.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/afsalm.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/afsalm.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/afsalm.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/afsalm.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/afsalm.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/afsalm.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/afsalm.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=afsalm.wordpress.com&amp;blog=4140963&amp;post=1&amp;subd=afsalm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://afsalm.wordpress.com/2008/07/04/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e801c773370f0a59e39751eaa77f458?s=96&#38;d=identicon" medium="image">
			<media:title type="html">afsalm</media:title>
		</media:content>
	</item>
	</channel>
</rss>
