<?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; MFC</title>
	<atom:link href="http://technoblogy.net/category/technology/mfc/feed/" rel="self" type="application/rss+xml" />
	<link>http://technoblogy.net</link>
	<description>Technology with a Big difference</description>
	<lastBuildDate>Thu, 09 Sep 2010 08:02:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to get open Windows in MFC</title>
		<link>http://technoblogy.net/how-to-get-open-windows-in-mfc/</link>
		<comments>http://technoblogy.net/how-to-get-open-windows-in-mfc/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 07:41:45 +0000</pubDate>
		<dc:creator>saim</dc:creator>
				<category><![CDATA[MFC]]></category>
		<category><![CDATA[getdesktopwindow]]></category>
		<category><![CDATA[getnextwindow]]></category>
		<category><![CDATA[getwindow]]></category>
		<category><![CDATA[getwindowtext]]></category>

		<guid isPermaLink="false">http://technoblogy.net/how-to-get-open-windows-in-mfc/</guid>
		<description><![CDATA[Hi, i have very little experience in MFC and VC++. I was developing a small project, during development i need to view the list of all opened windows in my explorer. i read somewhere and like to post the solution of this only for you It is very simple. here is the example by which [...]]]></description>
			<content:encoded><![CDATA[<p>Hi, i have very little experience in MFC and VC++. I was developing a small project, during development i need to view the list of all opened windows in my explorer. i read somewhere and like to post the solution of this only for you <img src='http://technoblogy.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>It is very simple. here is the example by which you can display titles of each window opened. try this and enjoy.    <br />In your OnInitDialog() write this…</p>
<blockquote><p>HWND hnd = ::GetWindow(::GetDesktopWindow(), GW_CHILD);      <br />CWnd *pWnd;       <br />CString csTitle = &quot;&quot;;</p>
<p>while( (hnd != NULL) )      <br />{       <br />pWnd = CWnd::FromHandle(hnd);       <br />pWnd-&gt;GetWindowText(csTitle);</p>
<p>MessageBox(csTitle, &quot;Title&quot;, NULL);      <br />hnd = *pWnd-&gt;GetNextWindow(GW_HWNDNEXT);       <br />}</p>
</blockquote>
<script type="text/javascript" class="owbutton" src="http://onlywire.com/btn/button_1305" title="How to get open Windows in MFC" url="http://technoblogy.net/how-to-get-open-windows-in-mfc/"></script>]]></content:encoded>
			<wfw:commentRss>http://technoblogy.net/how-to-get-open-windows-in-mfc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>
<script type="text/javascript" class="owbutton" src="http://onlywire.com/btn/button_1305" title="How to set border of CDialog" url="http://technoblogy.net/how-to-set-border-of-cdialog/"></script>]]></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>
<script type="text/javascript" class="owbutton" src="http://onlywire.com/btn/button_1305" title="Changing the background color of a dialog" url="http://technoblogy.net/changing-the-background-color-of-a-dialog-2/"></script>]]></content:encoded>
			<wfw:commentRss>http://technoblogy.net/changing-the-background-color-of-a-dialog-2/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/</link>
		<comments>http://technoblogy.net/changing-the-background-color-of-a-dialog/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 15:04:16 +0000</pubDate>
		<dc:creator>saim</dc:creator>
				<category><![CDATA[MFC]]></category>
		<category><![CDATA[background color]]></category>
		<category><![CDATA[cdialog]]></category>

		<guid isPermaLink="false">http://technoblogy.net/changing-the-background-color-of-a-dialog/</guid>
		<description><![CDATA[I have found this proper way to set the color of CDialog in MFC application. Write this Function in your class. HBRUSH CCaptureOPtionsDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { if( nCtlColor == 6 ) // for Slider control { pDC-&#62;SetBkMode(TRANSPARENT);// Set the Background Mode to TRANSPARENT } else if( nCtlColor == CTLCOLOR_DLG ) // for [...]]]></description>
			<content:encoded><![CDATA[<p>I have found this proper way to set the color of CDialog in MFC application.</p>
<p>Write this Function in your class.</p>
<blockquote><p>HBRUSH CCaptureOPtionsDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)      <br />{       <br />if( nCtlColor == 6 ) // for Slider control       <br />{       <br />pDC-&gt;SetBkMode(TRANSPARENT);// Set the Background Mode to TRANSPARENT }</p>
<p>else if( nCtlColor == CTLCOLOR_DLG ) // for dialog      <br />{       <br />pDC-&gt;SetTextColor(RGB(0, 0, 0)); // set the Text Color; black       <br />pDC-&gt;SetBkMode(TRANSPARENT); // Set the Background Mode to TRANSPARENT       <br />m_brush.CreateSolidBrush(RGB(214, 211, 206)); // Set RGB color any you want for your Dialog       <br />}       <br />return m_brush;       <br />}</p>
</blockquote>
<script type="text/javascript" class="owbutton" src="http://onlywire.com/btn/button_1305" title="Changing the background color of a dialog" url="http://technoblogy.net/changing-the-background-color-of-a-dialog/"></script>]]></content:encoded>
			<wfw:commentRss>http://technoblogy.net/changing-the-background-color-of-a-dialog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
