-
ListView & ImageLists
On second thought....
Initial problem solved, however a new one has just presented itself. How do you enable FULLROWSELECT in a ListView control?
I notice all or most of the ListView extended styles are either outdated or predated for Vista, so I cannot use them. I tried a trick by sending a LVS_SETEXTENDEDLISTVIEWSTYLE message, however my compiler refuses to recognize this constant (even though I've included commctrl32.lib and linked the library)...
So how does one create a full-row-select ListView? (short of creating an entire custom control from scratch)
- EDIT -
This seems to have turned into a compiler problem now...
After manually checking the commctrl.h file I FOUND that constant (value of 32) and now I am at a loss for words as to why it still refuses to define it, even though I've included it.
I am using CodeBlocks RC2, if anyone could provide any assitance I'd appreciate greatly, thanks!
p.s. tried it on Dev C++ too... both programs have commctrl.h in their include directories, both header files have the line "#define LVS_EX_FULLROWSELECT 32" in them, yet both refuse to recognize it as a constant. I'm about to explode here... I tried to shut it up with manually defining it, but that just caused my list box to behave quirky (so I guess it doesn't recognize the fullrow flag after all).
-
The Windows headers have a feature to help you target versions of the OS. Specifically, some functions and constants are only defined if you state that you are targeting (at least) the platform that they were introduced with. The idea is that you can't accidentally use newer functions and constants and break your program on older platforms, however the system is far from comprehensive.
You did the right thing by looking in the header file. If you look up from LVS_EX_FULLROWSELECT you will find its definition is only included
Code:
#if (_WIN32_IE >= 0x0300)
So to specify that you want to LVS_EX_FULLROWSELECT you can use a define above the commctrl.h include:
Code:
#define _WIN32_IE 0x0401
#include <commctrl.h>
Some more info is available at Shell and Common Controls Versions.
-
oh wow, thank you!!
I'm still finding my way around msdn... it's no javadocs, that's for sure :D