You might try setting up an WM_KILLFOCUS handler for the list control and running it in the debugger or something. It sounds like the control has actually lost focus, which might not be apparent because if you click on it again it temporarily gets focus, handles your click on the item, and then possibly loses focus again.
First, I'd double-verify that it's not losting focus by clicking on the control, then clicking on another control and making sure that the OnKillFocus handler is actually being called when I expect it to (it's possible depending on your message maps and parent/child relationships that the view is eating the messages).
If that plays out, and you're confident that the control truly is not losing focus, could it be a problem with transparency of your images in the image list and the background color of the text (and the text not being transparent), simply not letting the blue "show through"?
Yes, I have just verified that the control is not losing focus when it should not. Its OnSetFocus() and OnKillFocus() handlers are being called appropriately. When I select an item, the OnSetFocus() handler is called. The OnKillFocus() handler is not being called until I actually do move the focus. I have used different types & sizes of bitmaps and different parameters in creating the imagelist, but no change in the control's behavior.
I have just built a version of my test project using a CScrollView as the parent of the CListCtrl. It exhibits the same behavior as the dialog-based app and the CFormView-based app. That would seem to point to the images or the ImageList object that I am using. However, I have used this same ImageList & bitmaps in another project, but the selection behavior is correct.
Just to be safe, does explorer highlight in blue when you select a file? Its possible to have your "scheme" have the highlight color set to gray.
As another thought, is your ListView (or ListCtrl) derived from anything, meaning did you use a class from an outside source? Just wondering if perhaps you or that class might be using NM_CUSTOMDRAW to override painting.
Also, what styles are being used on the view, single selection, full-row selection, show selection always, owner data, owner draw?
Personally I've never seen a basic ListCtrl ever paint incorrectly without some kind of interference from code.
Oh, um, are you using a manifest under VC6? I know when you use manifests (to get the XP style look), imagelists behave differently. I think, but not certain by any means, that the newer compilers handle this without problems, but I'm fairly sure VC6 won't. I've found CImageList won't work quite right, I had to use the macros like ImageList_Create for it to work right.
VC7 has an option during project creation for including a manifest for C++ apps that defaults to "ON". Check your project or project/res directory for a .manifest file. If you have one, then its probably being used. Try turning it off.
How do I do that? My test app project has a manifest file, but my real project does not. With both projects exhibiting the same behavior, one has a manifest and the other does not, I can't believe that is the problem. Anyway, I can't find a setting in the project configuration for turning it on or off. I also searched the vcproj file for a hidden setting.