I'm trying to use grouping mode of lisview, in common controls 6

I have my application with a virtual listview in LVS_REPORT mode.
I have my manifest and I use common controls 6

I think the first step is to send message LVM_ENABLEGROUPMODE

invoke SendMessage, hList, LVM_ENABLEGROUPMODE, TRUE, 0
but it returns -1, that is to say, error

How can I enable grouping mode?
The only example-code I found, is on codeproject but is written in C#, and I can't understand it
Posted on 2004-08-12 14:19:59 by greenant
either my sdk is outdated, or there is no LVM_ENABLEGROUPMODE constant :/

the only thing i found is:

lResult = SendMessage(      // returns int in lResult     (HWND) hWndControl,      // handle to destination control     (UINT) LVM_ENABLEGROUPVIEW,      // message ID     (WPARAM) wParam,      // = (WPARAM) (BOOL) fEnable;    (LPARAM) lParam      // = (LPARAM) (LPARAM) lParam; );  

which tells to use LVM_ENABLEGROUPVIEW which is

#define LVM_FIRST 0x1000 // ListView messages
Posted on 2004-08-12 18:30:58 by ti_mo_n
I did a mistake writing this post (but not the code on my pc). It is LVM_ENABLEGROUPVIEW
Posted on 2004-08-13 02:37:09 by greenant
It doesn't work with LVS_OWNERDATA, but microsoft don't say that group view is incompatible with virtual list view!

It is a big problem because I need both virtual listview and grouped mode!!!
Posted on 2004-08-13 02:59:04 by greenant
1. Do not mind the file p.db, it's irrelevant on this example
2. If you wish to view the original program, just delete the code from ;******* START ******* to ;******* END ******* and uncomment any code after the comment ;Load data
3. XP Only. :(
Posted on 2004-08-13 04:35:54 by arkane
Thanks. I understand but I still have the problem. My listview use LVS_OWNERDATA (because I have 5000 items) and I cannot use grouping view with my virtual listview
Posted on 2004-08-13 04:47:33 by greenant
I will try to emulate groupmode with custom draw. So it will work also with common controls < 6
Posted on 2004-08-13 04:53:22 by greenant