<?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; wParam</title>
	<atom:link href="http://vdiscussion.com/tag/wparam/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 Dead-Character Messages in Visual Programming</title>
		<link>http://vdiscussion.com/what-is-dead-character-messages-in-visual-programming/</link>
		<comments>http://vdiscussion.com/what-is-dead-character-messages-in-visual-programming/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 14:21:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[ANSI]]></category>
		<category><![CDATA[ASCII]]></category>
		<category><![CDATA[Dead-Character Messages]]></category>
		<category><![CDATA[WM_CHAR]]></category>
		<category><![CDATA[WM_DEADCHAR]]></category>
		<category><![CDATA[WM_SYSDEADCHAR]]></category>
		<category><![CDATA[wParam]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=59</guid>
		<description><![CDATA[Windows programs can usually ignore WM_DEADCHAR and WM_SYSDEADCHAR messages, but you should definitely know what dead characters are and how they work. On some non-U.S. English keyboards, certain keys are defined to add a diacritic to a letter. These are called &#8220;dead keys&#8221; because they don&#8217;t generate characters by themselves. For instance, when a German [...]]]></description>
			<content:encoded><![CDATA[<p>Windows programs can usually ignore <strong>WM_DEADCHAR</strong> and <strong>WM_SYSDEADCHAR</strong> messages,  but you should definitely know what dead characters are and how they work.</p>
<p>On some non-U.S. English keyboards, certain keys are defined to add a  diacritic to a letter. These are called &#8220;dead keys&#8221; because they don&#8217;t generate  characters by themselves. For instance, when a German keyboard is installed, the  key that is in the same position as the +/= key on a U.S. keyboard is a dead key  for the grave accent (`) when shifted and the acute accent (´) when unshifted.</p>
<p>When a user presses this dead key, your window procedure receives a  <strong>WM_DEADCHAR</strong> message with <strong><em>wParam</em></strong> equal to ASCII or Unicode code for the  diacritic by itself. When the user then presses a letter key that can be written  with this diacritic (for instance, the A key), the window procedure receives a  <strong>WM_CHAR</strong> message where <em>wParam</em> is the ANSI code for the letter `a&#8217; with the  diacritic.</p>
<p>Thus, your program does not have to process the <strong>WM_DEADCHAR</strong> message because  the <strong>WM_CHAR</strong> message gives the program all the information it needs. The Windows  logic even has built-in error handling: If the dead key is followed by a letter  that can&#8217;t take a diacritic (such as `s&#8217;), the window procedure receives two <strong> WM_CHAR</strong> messages in a row—the first with <em>wParam</em> equal to the <strong>ASCII</strong> code  for the diacritic by itself (the same <em>wParam</em> value delivered with the  WM_DEADCHAR message) and the second with <em>wParam</em> equal to the <strong>ASCII</strong> code  for the letter `s&#8217;.</p>
<p>Of course, the best way to get a feel for this is to see it in action. You  need to load a foreign keyboard that uses dead keys, such as the German keyboard  that I described earlier. You do this in the Control Panel by selecting Keyboard  and then the Language tab. Then you need an application that shows you the  details of every keyboard message a program can receive.</p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/what-is-dead-character-messages-in-visual-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scroll Bar Messages:Visual Programming</title>
		<link>http://vdiscussion.com/scroll-bar-messages-visual-programming/</link>
		<comments>http://vdiscussion.com/scroll-bar-messages-visual-programming/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 02:42:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Theory Subjects]]></category>
		<category><![CDATA[Visual Programming]]></category>
		<category><![CDATA[SB_THUMBPOSITION]]></category>
		<category><![CDATA[SB_THUMBTRACK]]></category>
		<category><![CDATA[Scroll Bar Messages]]></category>
		<category><![CDATA[WINUSER.H]]></category>
		<category><![CDATA[WM_HSCROLL]]></category>
		<category><![CDATA[WM_VSCROLL]]></category>
		<category><![CDATA[wParam]]></category>

		<guid isPermaLink="false">http://vdiscussion.com/?p=19</guid>
		<description><![CDATA[Windows sends the window procedure WM_VSCROLL (vertical scroll) and WM_HSCROLL (horizontal scroll) messages when the scroll bar is clicked with the mouse or the thumb is dragged. Each mouse action on the scroll bar generates at least two messages, one when the mouse button is pressed and another when it is released. WM_VSCROLL and WM_HSCROLL [...]]]></description>
			<content:encoded><![CDATA[<p>Windows sends the window procedure WM_VSCROLL (vertical scroll) and WM_HSCROLL  (horizontal scroll) messages when the scroll bar is clicked with the mouse or  the thumb is dragged. Each mouse action on the scroll bar generates at least two  messages, one when the mouse button is pressed and another when it is released.</p>
<p>WM_VSCROLL and WM_HSCROLL are accompanied by the <em>wParam</em> and <em>lParam</em> message parameters. For messages from scroll bars created as part of your  window, you can ignore <em>lParam</em>; that&#8217;s used only for scroll bars created  as child windows, usually within dialog boxes.</p>
<p>The <em>wParam</em> message parameter is divided into a <strong>low word and a high  word</strong>. The low word of <em>wParam</em> is a number that indicates what the mouse is  doing to the scroll bar. This number is referred to as a &#8220;notification code.&#8221;  Notification codes have values defined by identifiers that begin with SB, which  stands for &#8220;scroll bar.&#8221; Here&#8217;s how the notification codes are defined in  WINUSER.H:</p>
<blockquote><p>#define SB_LINEUP           0<br />
#define SB_LINELEFT         0<br />
#define SB_LINEDOWN         1<br />
#define SB_LINERIGHT        1<br />
#define SB_PAGEUP           2<br />
#define SB_PAGELEFT         2<br />
#define SB_PAGEDOWN         3<br />
#define SB_PAGERIGHT        3<br />
#define SB_THUMBPOSITION    4<br />
#define SB_THUMBTRACK       5<br />
#define SB_TOP              6<br />
#define SB_LEFT             6<br />
#define SB_BOTTOM           7<br />
#define SB_RIGHT            7<br />
#define SB_ENDSCROLL        8</p></blockquote>
<p><img class="alignnone size-full wp-image-20" title="Scroll Bar Messages" src="http://vdiscussion.com/wp-content/uploads/2009/10/Scroll-Bar-Messages.jpg" alt="Scroll Bar Messages" width="600" height="450" /></p>
<p>If you hold down the mouse button on the various parts of the scroll bar, your  program can receive multiple scroll bar messages. When the mouse button is  released, you&#8217;ll get a message with a notification code of SB_ENDSCROLL. You can  generally ignore messages with the SB_ENDSCROLL notification code. Windows will  not change the position of the scroll bar thumb. Your application does that by  calling <em>SetScrollPos</em>.</p>
<p>When you position the mouse cursor over the scroll bar thumb and press the mouse  button, you can move the thumb. This generates scroll bar messages with  notification codes of SB_THUMBTRACK and SB_THUMBPOSITION. When the low word of  <em>wParam</em> is SB_THUMBTRACK, the high word of <em>wParam</em> is the current  position of the scroll bar thumb as the user is dragging it. This position is  within the minimum and maximum values of the scroll bar range. When the low word  of <em>wParam</em> is SB_THUMBPOSITION, the high word of <em>wParam</em> is the  final position of the scroll bar thumb when the user released the mouse button.  For other scroll bar actions, the high word of <em>wParam</em> should be ignored.</p>
<p>To provide feedback to the user, Windows will move the scroll bar thumb when  you drag it with the mouse as your program is receiving SB_THUMBTRACK messages.  However, unless you process SB_THUMBTRACK or SB_THUMBPOSITION messages by  calling <em>SetScrollPos</em>, the thumb will snap back to its original position  when the user releases the mouse button.</p>
<p>A program can process either the SB_THUMBTRACK or SB_THUMBPOSITION messages, but  doesn&#8217;t usually process both. If you process SB_THUMBTRACK messages, you&#8217;ll move  the contents of your client area as the user is dragging the thumb. If instead  you process SB_THUMBPOSITION messages, you&#8217;ll move the contents of the client  area only when the user <em>stops</em> dragging the thumb.</p>
<p>The WINUSER.H header files includes notification codes of SB_TOP, SB_BOTTOM,  SB_LEFT, and SB_RIGHT, indicating that the scroll bar has been moved to its  minimum or maximum position. However, you will never receive these notification  codes for a scroll bar created as part of your application window.</p>
<p>Although it&#8217;s not common, using 32-bit values for the scroll bar range is  perfectly valid. However, the high word of <em>wParam</em>, which is only a 16-bit  value, cannot properly indicate the position for SB_THUMBTRACK and  SB_THUMBPOSITION actions. In this case, you need to use the function  <em>GetScrollInfo</em></p>
]]></content:encoded>
			<wfw:commentRss>http://vdiscussion.com/scroll-bar-messages-visual-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
