<?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>Vdiscussion &#187; WM_PAINT</title>
	<atom:link href="http://vdiscussion.com/tag/wm_paint/feed/" rel="self" type="application/rss+xml" />
	<link>http://vdiscussion.com</link>
	<description>Vinoth Kumar&#039;s Discussion</description>
	<lastBuildDate>Wed, 09 Dec 2009 15:34:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>What is Valid and Invalid Rectangles in Visual Programming</title>
		<link>http://vdiscussion.com/what-is-valid-and-invalid-rectangles-in-visual-programming/</link>
		<comments>http://vdiscussion.com/what-is-valid-and-invalid-rectangles-in-visual-programming/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 13:37:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[BeginPaint]]></category>
		<category><![CDATA[GetUpdateRect]]></category>
		<category><![CDATA[invalid region]]></category>
		<category><![CDATA[paint information structure]]></category>
		<category><![CDATA[update region]]></category>
		<category><![CDATA[ValidateRect]]></category>
		<category><![CDATA[WM_PAINT]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=37</guid>
		<description><![CDATA[Window procedure should be prepared to update the entire client area whenever it receives a WM_PAINT message, it often needs to update only a smaller area, most often a rectangular area within the client area. This is most obvious when a dialog box overlies part of the client area. Repainting is required only for the [...]]]></description>
			<content:encoded><![CDATA[<p>Window procedure should be prepared to update the entire client area whenever it  receives a <strong>WM_PAINT</strong> message, it often needs to update only a smaller area, most  often a rectangular area within the client area. This is most obvious when a  dialog box overlies part of the client area. Repainting is required only for the  rectangular area uncovered when the dialog box is removed.</p>
<p>That area is known as an &#8220;<strong>invalid region</strong>&#8221; or &#8220;<strong>update region</strong>.&#8221; The presence of  an invalid region in a client area is what prompts Windows to place a <strong>WM_PAINT</strong> message in the application&#8217;s message queue. Your window procedure receives a  <strong>WM_PAINT</strong> message only if part of your client area is invalid.</p>
<p>Windows internally maintains a &#8220;<em>paint information structure</em>&#8221; for each window.  This structure contains, among other information, the coordinates of the  smallest rectangle that encompasses the invalid region. This is known as the  &#8220;invalid rectangle.&#8221; If another region of the client area becomes invalid before  the window procedure processes a pending <strong>WM_PAINT</strong> message, Windows calculates a  new invalid region (and a new invalid rectangle) that encompasses both areas and  stores this updated information in the paint information structure. Windows does  not place multiple <strong>WM_PAINT </strong>messages in the message queue.</p>
<p>A window procedure can invalidate a rectangle in its own client area by  calling <em>InvalidateRect</em>. If the message queue already contains a WM_PAINT  message, Windows calculates a new invalid rectangle. Otherwise, it places a  WM_PAINT message in the message queue. A window procedure can obtain the  coordinates of the invalid rectangle when it receives a WM_PAINT message (as  we&#8217;ll see later in this chapter). It can also obtain these coordinates at any  other time by calling <strong><em>GetUpdateRect</em></strong>.</p>
<p>After the window procedure calls <strong><em>BeginPaint</em></strong> during the WM_PAINT  message, the entire client area is validated. A program can also validate any  rectangular area within the client area by calling the <em>ValidateRect</em> function. If this call has the effect of validating the entire invalid area,  then any WM_PAINT message currently in the queue is removed.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/what-is-valid-and-invalid-rectangles-in-visual-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WM_PAINT Message Visual Programming</title>
		<link>http://vdiscussion.com/wm_paint-message-visual-programming/</link>
		<comments>http://vdiscussion.com/wm_paint-message-visual-programming/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 13:01:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[CS_HREDRAW]]></category>
		<category><![CDATA[CW_VREDRAW]]></category>
		<category><![CDATA[ScrollDC function]]></category>
		<category><![CDATA[ScrollWindow function]]></category>
		<category><![CDATA[UpdateWindow]]></category>
		<category><![CDATA[WinMain]]></category>
		<category><![CDATA[WM PAINT]]></category>
		<category><![CDATA[WM_PAINT]]></category>
		<category><![CDATA[WM_PAINT Function]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=34</guid>
		<description><![CDATA[Windows programs call the function UpdateWindow during initialization in WinMain shortly before entering the message loop. Windows takes this opportunity to send the window procedure its first WM_PAINT message. This message informs the window procedure that the client area must be painted. Thereafter, that window procedure should be ready at almost any time to process [...]]]></description>
			<content:encoded><![CDATA[<p>Windows programs call the function <strong><em>UpdateWindow</em></strong> during  initialization in <strong><em>WinMain</em></strong> shortly before entering the message loop.  Windows takes this opportunity to send the window procedure its first <strong>WM_PAINT</strong> message. This message informs the window procedure that the client area must be  painted. Thereafter, that window procedure should be ready at almost any time to  process additional <strong>WM_PAINT</strong> messages and even to repaint the entire client area  of the window if necessary. A window procedure receives a WM_PAINT message  whenever one of the following events occurs:</p>
<ul>
<li>A previously hidden area of the window is brought into view when a user  moves a window or uncovers a window.</li>
<li>The user resizes the window (if the window class style has the <strong>CS_HREDRAW</strong> and <strong>CW_VREDRAW</strong> bits set).</li>
<li>The program uses the <em>ScrollWindow</em> or <em>ScrollDC</em> function to  scroll part of its client area.</li>
<li>The program uses the <em>InvalidateRect</em> or <em>InvalidateRgn</em> function  to explicitly generate a <em>WM_PAINT</em> message.</li>
</ul>
<p>In some cases when part of the client area is temporarily written over,  Windows attempts to save an area of the display and restore it later. This is  not always successful. Windows may sometimes post a <strong>WM_PAINT</strong> message when:</p>
<ul>
<li>Windows removes a dialog box or message box that was overlaying part of the  window.</li>
<li>A menu is pulled down and then released.</li>
<li>A tool tip is displayed.</li>
</ul>
<p>In a few cases, Windows always saves the area of the display it overwrites  and then restores it. This is the case whenever:</p>
<ul>
<li>The mouse cursor is moved across the client area.</li>
<li>An icon is dragged across the client area.</li>
</ul>
<p>Dealing with <strong>WM_PAINT</strong> message requires that you alter the way you think about  how you write to the video display. Your program should be structured so that it  accumulates all the information necessary to paint the client area but paints  only &#8220;on demand&#8221;—when Windows sends the window procedure a <strong>WM_PAINT</strong> message. If  your program needs to update its client area at some other time, it can force  Windows to generate this <strong>WM_PAINT</strong> message. This may seem a roundabout method of  displaying something on the screen, but the structure of your program will  benefit from it.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/wm_paint-message-visual-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
