<?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>Jacob Repp &#187; windows</title>
	<atom:link href="http://jrepp.com/category/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://jrepp.com</link>
	<description>Game programming, music and life</description>
	<lastBuildDate>Fri, 16 Dec 2011 06:03:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Select a Single Item in a List View Control</title>
		<link>http://jrepp.com/2009/07/31/select-a-single-item-in-a-list-view-control/</link>
		<comments>http://jrepp.com/2009/07/31/select-a-single-item-in-a-list-view-control/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 18:43:20 +0000</pubDate>
		<dc:creator>proj</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://jrepp.com/2009/07/31/select-a-single-item-in-a-list-view-control/</guid>
		<description><![CDATA[This simple operation took me longer to figure out than I would like, the answer wasn&#8217;t obvious on msdn or in any of the searches I did so I figure I should just put it up here for anyone else &#8230; <a href="http://jrepp.com/2009/07/31/select-a-single-item-in-a-list-view-control/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This simple operation took me longer to figure out than I would like, the answer wasn&#8217;t obvious on msdn or in any of the searches I did so I figure I should just put it up here for anyone else who might look for it:</p>

<p>To select an item in a list view create an LVITEM structure, change a few of it&#8217;s fields and pass it to LVM_SETITEMSTATE:</p>

<pre><code>// Select current item in the list
LVITEM item = {0};
item.mask = LVIF_STATE;
item.state = item.stateMask = LVIS_SELECTED;
SendMessage(mhProductList, LVM_SETITEMSTATE, mCurrentSettings, (LPARAM)&amp;item);
</code></pre>

<p>Oh and if you&#8217;re trying to turn on whole line section you&#8217;ll need to use the extended styles:</p>

<pre><code>// Set extended styles
SendMessage(hWndListView, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://jrepp.com/2009/07/31/select-a-single-item-in-a-list-view-control/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

