What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » List-view groups

List-view groups
Author: Message:
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. List-view groups
Hi everyone! Been absent for a couple of months due to school business, but now I'm back again.

Anyways, to the point: would it be possible for any of you guys to implement groups in Matti's List-view class? I've tried a couple of times, only to crash Messenger (A) :P
10-16-2010 12:24 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: List-view groups
Have you managed to get it working outside of his class?

If not have a look at this: http://www.winapizone.net/tutorials/winapi/listview/groups.php
10-16-2010 01:31 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: List-view groups
My ListView class has a helper function to create an LVITEM (ListView.Helpers.LVITEM). This function is used when you add or change items in the list view.

My guess is that you'll need to add some code to that function to add support for groups. You'll have to add a parameter to the LVITEM function so you can pass in the wanted group ID. When this parameter is set, you need to write the value for iGroupId to the structure and add LVIF_GROUPID and LVIF_COLUMNS to the Mask. Of course, you'll also need to add and pass the group parameter to the functions using LVITEM (e.g. InsertItem).

I don't know how sorting and grouping would work together though. I'd recommend you try to get grouping to work without the ListView class and if that works, you could try to combine it with the ListView class.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
10-16-2010 03:14 PM
Profile E-Mail PM Web Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. RE: List-view groups
@Matti: seems like I'm using an outdated version of your class? I copied it from Countdown live 2.1 and did some edits to it; I'll attach a ZIP file for ya :P

@matty: I've had no luck yet.. Here's my code (besides the class):

JScript code:
            MsgPlus.AddTimer("TmrLoadStuff",100);
            objPlusWnd.RegisterMessageNotification(WM_NOTIFY);
            MsgPlus.DisplayToast("",objPlusWnd.SendControlMessage("vLstContacts",LVM_ENABLEGROUPVIEW,true,0));
            var LVGROUP = Interop.Allocate(96);
            var Header = "First group!";
            var pszHeader = Interop.Allocate((Header.length + 1) * 2);
            with(LVGROUP) {
                writeDWORD(0,Size);
                writeDWORD(4,LVGF_HEADER | LVGF_GROUPID | 0x200 /* LVIF_COLUMNS */);
                writeDWORD(8,pszHeader.DataPtr);
                writeDWORD(12,pszHeader.Size);
                writeDWORD(24,101);
            }
            MsgPlus.DisplayToast("",objPlusWnd.SendControlMessage("vLstContacts",LVM_INSERTGROUP,-1,LVGROUP.DataPtr));
            var vLstContacts = new ListView(objPlusWnd,"vLstContacts");
            vLstContacts.InsertItem("Test item!",undefined,0,101);

Both toasts display a 1, indicating at least some success. But the result is an empty list view.

.zip File Attachment: ListView.zip (8.43 KB)
This file has been downloaded 116 time(s).

This post was edited on 10-16-2010 at 05:19 PM by SmokingCookie.
10-16-2010 05:18 PM
Profile PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. RE: List-view groups
On a more related side note: as of now, I do have one working example at home (I'm at school now), I'll try to polish it a bit more and post it then.

Oh and it might be handy to split the DataType class bit off of this thread :P
10-19-2010 10:24 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On