<?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; Scroll Bar Range</title>
	<atom:link href="http://vdiscussion.com/tag/scroll-bar-range/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>Scroll Bar Range and Position</title>
		<link>http://vdiscussion.com/scroll-bar-range-and-position/</link>
		<comments>http://vdiscussion.com/scroll-bar-range-and-position/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 01:47:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[Scroll Bar Position]]></category>
		<category><![CDATA[Scroll Bar Range]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=14</guid>
		<description><![CDATA[Scroll Bar Range and Position]]></description>
			<content:encoded><![CDATA[<p>Every scroll bar has an associated &#8220;range&#8221; and &#8220;position.&#8221; The scroll bar range is a pair of integers representing a minimum and maximum value associated with the scroll bar. The position is the location of the thumb within the range. When the thumb is at the top (or left) of the scroll bar, the position of the thumb is the minimum value of the range. At the bottom (or right) of the scroll bar, the thumb position is the maximum value of the range.</p>
<p>By default, the range of a scroll bar is 0 (top or left) through 100 (bottom or right), but it&#8217;s easy to change the range to something that is more convenient for the program:</p>
<blockquote><p>SetScrollRange (hwnd, iBar, iMin, iMax, bRedraw) ;</p></blockquote>
<p><em>iBar</em> argument is either SB_VERT or SB_HORZ.</p>
<p><em>iMin</em> and <em>iMax</em> are the new minimum and maximum positions of the  range.</p>
<p><em>bRedraw</em> to TRUE if you want Windows to redraw the scroll bar based on the  new range. (If you will be calling other functions that affect the appearance of  the scroll bar after you call <em>SetScrollRange</em>, you&#8217;ll probably want to set  <em>bRedraw</em> to FALSE to avoid excessive redrawing.)</p>
<p><em>hwnd</em> parameter to the window procedure is the handle of the window  changing in size. (Remember that one window procedure could be handling messages  for multiple windows that were created based on the same window class. The  <em>hwnd</em> parameter lets the window procedure know which window is receiving  the message.) The <em>message</em> parameter is WM_SIZE. The <em>wParam</em> parameter for a WM_SIZE message is the value SIZE_RESTORED, SIZE_MINIMIZED,  SIZE_MAXIMIZED, SIZE_MAXSHOW, or SIZE_MAXHIDE (defined in the WINUSER.H header  file as the numbers 0 through 4). That is, the <em>wParam</em> parameter indicates  whether the window is being changed to a nonminimized or nonmaximized size,  being minimized, being maximized, or being hidden.</p>
<p>The thumb position is always a discrete integral value. For instance, a scroll  bar with a range of 0 through 4 has five thumb positions<br />
<img class="alignnone size-full wp-image-15" title="scrollbar" src="http://vdiscussion.com/wp-content/uploads/2009/10/scrollbar.jpg" alt="Scroll Bar Range and Position" width="423" height="298" /></p>
<p><strong>How to set the Thumb Position of the window</strong></p>
<blockquote><p>SetScrollPos (hwnd, iBar, iPos, bRedraw);</p></blockquote>
<p><em>SetScrollPos</em> to set a new thumb position within the scroll bar range.</p>
<p>iPos argument is the new position and must be within the range of iMin and iMax. Windows provides similar functions (GetScrollRange and GetScrollPos) to obtain the current range and position of a scroll bar.</p>
<p><strong>Windows&#8217; responsibilities for scroll bars:</strong></p>
<ul>
<li>Handle all processing of mouse messages to the scroll bar.</li>
<li>Provide a reverse-video &#8220;flash&#8221; when the user clicks the scroll bar.</li>
<li>Move the thumb as the user drags the thumb within the scroll bar.</li>
<li>Send scroll bar messages to the window procedure of the window containing  the scroll bar.</li>
</ul>
<p><strong>Responsibilities of your program:</strong></p>
<ul>
<li>Initialize the range and position of the scroll bar.</li>
<li>Process the scroll bar messages to the window procedure.</li>
<li>Update the position of the scroll bar thumb.</li>
<li>Change the contents of the client area in response to a change in the scroll  bar.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/scroll-bar-range-and-position/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
