<?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>TechnoBlogy &#187; dialog</title>
	<atom:link href="http://technoblogy.net/tag/dialog/feed/" rel="self" type="application/rss+xml" />
	<link>http://technoblogy.net</link>
	<description>Technology with a Big difference</description>
	<lastBuildDate>Mon, 05 Dec 2011 17:29:42 +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>How to set border of CDialog</title>
		<link>http://technoblogy.net/how-to-set-border-of-cdialog/</link>
		<comments>http://technoblogy.net/how-to-set-border-of-cdialog/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 15:24:12 +0000</pubDate>
		<dc:creator>saim</dc:creator>
				<category><![CDATA[MFC]]></category>
		<category><![CDATA[border]]></category>
		<category><![CDATA[cdialog]]></category>
		<category><![CDATA[crect]]></category>
		<category><![CDATA[dialog]]></category>
		<category><![CDATA[framerect]]></category>
		<category><![CDATA[getwindowdc]]></category>
		<category><![CDATA[offsetrect]]></category>
		<category><![CDATA[onctlcolor]]></category>
		<category><![CDATA[on_wm_ctlcolor]]></category>
		<category><![CDATA[vc++]]></category>

		<guid isPermaLink="false">http://technoblogy.net/how-to-set-border-of-cdialog/</guid>
		<description><![CDATA[I am new in MFC. I put some time to draw a border around a Dialog in MFC application. Here is the solution that i found. It is very simple for any level of programmer. Follow just three simple steps. Step1: Add OnCtlColor() method in your Message map like:- BEGIN_MESSAGE_MAP(CDATToSWFDlg, CTrayDialog) ON_WM_CTLCOLOR() END_MESSAGE_MAP() Step2: Add [...]]]></description>
			<content:encoded><![CDATA[<p>I am new in MFC. I put some time to draw a border around a Dialog in MFC application. Here is the solution that i found. It is very simple for any level of programmer.</p>
<p>Follow just three simple steps.</p>
<p><strong>Step1:</strong></p>
<p>Add OnCtlColor() method in your Message map like:-</p>
<blockquote><p><strong>BEGIN_MESSAGE_MAP(CDATToSWFDlg, CTrayDialog)        <br />ON_WM_CTLCOLOR()</strong> <strong>       <br />END_MESSAGE_MAP()</strong></p>
</blockquote>
<p><strong>Step2:</strong></p>
<p>Add this method in your code.</p>
<blockquote><blockquote>
<p>HBRUSH CDATToSWFDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)        <br />{</p>
<p>CBrush m_brush;</p>
<p>m_brush.CreateSolidBrush(RGB(239, 255, 255)); // Set color to your Dialog        <br />///////// SETTING BORDER /////////</p>
</blockquote>
<blockquote><p>pDC = GetWindowDC();        <br />CRect rect;         <br />GetWindowRect(&amp;rect);         <br />rect.OffsetRect( -rect.left, -rect.top);         <br />CBrush brush( RGB(0, 0, 0)); // Color of your desired border         <br />pDC-&gt;FrameRect( &amp;rect, &amp;brush);         <br />int borderWidth = 4; // Set the width of your desired border.         <br />for(int i=1; i&lt;borderWidth; i++)         <br />{         <br />rect.OffsetRect( -rect.left+i, -rect.top+i);         <br />pDC-&gt;FrameRect( &amp;rect, &amp;brush);         <br />}         <br />HDC hdc = pDC-&gt;GetSafeHdc();         <br />for(i=1; i&lt;borderWidth; i++)         <br />{         <br />rect.OffsetRect( -rect.left-i, -rect.top-i);         <br />pDC-&gt;FrameRect( &amp;rect, &amp;brush);         <br />}         <br />ReleaseDC(pDC);         <br />//////////////////////////////////         <br />return m_brush;         <br />}</p>
</blockquote>
</blockquote>
<p><strong>Step3:</strong></p>
<p>Define OnCtlColor() method in header file of Dialog like:-</p>
<blockquote><p>class CDATToSWFDlg: public CDialog      <br />{       <br />// Construction       <br />public:       <br />HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);       <br />}</p>
</blockquote>
<p>Thats it…. Now just run it and enjoy <img src='http://technoblogy.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />     <br />But please add in comments if you have any powerful solution.     <br />Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://technoblogy.net/how-to-set-border-of-cdialog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing the background color of a dialog</title>
		<link>http://technoblogy.net/changing-the-background-color-of-a-dialog-2/</link>
		<comments>http://technoblogy.net/changing-the-background-color-of-a-dialog-2/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 16:17:38 +0000</pubDate>
		<dc:creator>saim</dc:creator>
				<category><![CDATA[MFC]]></category>
		<category><![CDATA[dialog]]></category>

		<guid isPermaLink="false">http://technoblogy.net/changing-the-background-color-of-a-dialog-2/</guid>
		<description><![CDATA[If you want to change the background color of your dialog box, it is a very simple. In your CTestDlg header file, declare a member variable from CBrush: class CTestDlg : public CDialog{&#8230;protected: CBrush m_brush;&#8230;}; Then, add this line in the OnInitDialog function: BOOL CTestDlg::OnInitDialog(){ &#8230; m_brush.CreateSolidBrush(RGB(255, 255, 255)); // color white brush &#8230; } [...]]]></description>
			<content:encoded><![CDATA[</p>
<p>If you want to change the background color of your dialog box, it is a very simple.</p>
<p>In your CTestDlg header file, declare a member variable from CBrush:</p>
<p>class CTestDlg : public CDialog{&#8230;protected: CBrush m_brush;&#8230;};</p>
<p>Then, add this line in the OnInitDialog function:</p>
<p>BOOL CTestDlg::OnInitDialog(){ &#8230; m_brush.CreateSolidBrush(RGB(255, 255, 255)); </p>
<p>// color white brush &#8230;</p>
<p>}</p>
<p>Finally do this on the ID_CTLCOLOR handle:</p>
<p>BEGIN_MESSAGE_MAP(CDesktopToSWFDlg, CTrayDialog) ON_WM_CTLCOLOR()END_MESSAGE_MAP()</p>
<p>HBRUSH CAboutDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor){</p>
<p>/*** No need to do this!**** </p>
<p>HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);</p>
<p>*//*** Return the white brush.*/</p>
<p>return m_brush;}</p>
<p>Hope it could help any fellow programmer.</p>
]]></content:encoded>
			<wfw:commentRss>http://technoblogy.net/changing-the-background-color-of-a-dialog-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

