Thread: ListView & ImageLists

  1. #1
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591

    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).
    Last edited by @nthony; 07-16-2006 at 01:24 AM.

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    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.

  3. #3
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    oh wow, thank you!!
    I'm still finding my way around msdn... it's no javadocs, that's for sure

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ListView Refresh, Update
    By de4th in forum C++ Programming
    Replies: 1
    Last Post: 12-23-2006, 09:13 AM
  2. Replies: 6
    Last Post: 07-10-2006, 12:05 AM
  3. Troubles with ListView and Toolbar
    By cornholio in forum Windows Programming
    Replies: 8
    Last Post: 11-14-2005, 01:26 AM
  4. Listview??
    By SuperNewbie in forum C# Programming
    Replies: 4
    Last Post: 02-13-2003, 03:34 AM
  5. ListView Version 6.0 and ImageLists
    By blundstrom in forum Windows Programming
    Replies: 0
    Last Post: 07-26-2002, 09:35 AM