Solved

ListView_SetItemState

Posted on 2000-04-15
1
1,392 Views
Last Modified: 2013-12-03
In my list view I want to highlight the item at the current cursor position. I used ListView_SetItemState with LVIS_SELECTED to highlight the item. The problem is that when the cursor moves to a new item I want to highlight the new item and clear the state of the previous item. If I have the index to the previous item how can I clear its highlighted state?
0
Comment
Question by:nadirkamal
1 Comment
 

Accepted Solution

by:
vessel earned 40 total points
ID: 2719048
hi nadirkamal!

This call will clear the item's highlighted state:
ListView_SetItemState(hwndX, nIndex, 0, LVIS_SELECTED);
and this will select the item:
ListView_SetItemState(hwndX, nIndex, LVIS_SELECTED, LVIS_SELECTED);

ListView_SetItemState(
    HWND hwnd,
    int i,
    UINT state, // 0 if you want to clear bits
                  // or flags (LVIS_SELECTED) to set
    UINT mask   // Bits which you want to set or clear
);
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now