What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] Trying to get into the advanced stuff

Pages: (2): « First [ 1 ] 2 » Last »
[?] Trying to get into the advanced stuff
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
O.P. [?] Trying to get into the advanced stuff
Okay, for a very long time I managed to do all my scripting stuff using just JScript code with some API calls. But that time seems to be ended...

I want to make my ListViewControl's columns sortable. This can be done usign the LVM_SORTITEMS message, but because Plus! doesn't support function pointers I'll need to program a DLL with a function to do this and call it from my script. The only problem is: I have no clue how. I never programmed a DLL before. :P

So, if anyone's interested in helping me with this, please PM me so I can give you my Messenger address. :)

Thanks in advance!

This post was edited on 06-09-2007 at 03:02 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-09-2007 03:02 PM
Profile E-Mail PM Web Find Quote Report
Volv
Skinning Contest Winner
*****

Avatar

Posts: 1233
Reputation: 31
35 / Male / Flag
Joined: Oct 2004
RE: [?] Trying to get into the advanced stuff
ListViewControl columns can be made sortable within the schema file can't they?
code:
<ReportView>
    <SortColHeader>true</SortColHeader>
</ReportView>
06-09-2007 03:40 PM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
O.P. RE: [?] Trying to get into the advanced stuff
quote:
Originally posted by Volv
ListViewControl columns can be made sortable within the schema file can't they?
code:
<ReportView>
    <SortColHeader>true</SortColHeader>
</ReportView>

If it would've been that easy, I'd already have done that! :P
No, Plus!' scripting engine still has a lot of incomplete features, including this one. Developers have to code it in manually, which I'm trying to do now.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-09-2007 03:49 PM
Profile E-Mail PM Web Find Quote Report
Volv
Skinning Contest Winner
*****

Avatar

Posts: 1233
Reputation: 31
35 / Male / Flag
Joined: Oct 2004
RE: [?] Trying to get into the advanced stuff
Hmm ok, you're right - it doesn't work :(
I only just realised that I had that tag in my script all along and didn't even know about it :p
06-09-2007 04:06 PM
Profile PM Find Quote Report
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: [?] Trying to get into the advanced stuff
I don't get what you would do with function pointers, but I have PMed you, hopefully I can help you. :)
4 8 15 16 23 42
06-09-2007 04:17 PM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: [?] Trying to get into the advanced stuff
I was looking at this just last week and though that Patchou should have really put events on the column names being pressed and was suprised it wasn't there and that they weren't called through the CtrlClicked event.  The only work around I could think of was to remove the top bar and sit buttons there instead, but then you can't use the <SortColHeader> which is unfortunate (but I have been too lazy to do this....).  I'm sure your method is probably going to be better, but if you wanted to be lazy like me then this way is always a possibility (and will only require JScript).
[Image: markee.png]
06-10-2007 07:02 AM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
O.P. RE: [?] Trying to get into the advanced stuff
quote:
Originally posted by markee
I was looking at this just last week and though that Patchou should have really put events on the column names being pressed and was suprised it wasn't there and that they weren't called through the CtrlClicked event.  The only work around I could think of was to remove the top bar and sit buttons there instead, but then you can't use the <SortColHeader> which is unfortunate (but I have been too lazy to do this....).  I'm sure your method is probably going to be better, but if you wanted to be lazy like me then this way is always a possibility (and will only require JScript).
But then, it'd be better to write it with a DLL, since then you can actually receive notifications from window controls and use function pointers... I just want to learn HOW. :)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-10-2007 11:49 AM
Profile E-Mail PM Web Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: [?] Trying to get into the advanced stuff
To detect when someone clicks the column header, you don't have to write a dll to subclass the ListView at all. ListView controls send a WM_NOTIFY message to the parent window for various events, including when the column headers are clicked, which means you can detect it in JScript using PlusWnd.RegisterMessageNotification().

I have attached a little example script to detect column header clicks, enjoy :P

Note: if you have multiple ListViews, you can distinguish between them by reading the hwndFrom of the NMLISTVIEW structure.
if(NMLISTVIEW.ReadDWORD(0) == Wnd.GetControlHandle("<ControlId>"))...

.plsc File Attachment: _ListViewControl_ColumnClicked.plsc (1.8 KB)
This file has been downloaded 202 time(s).

This post was edited on 06-10-2007 at 01:35 PM by Eljay.
06-10-2007 01:28 PM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
O.P. RE: [?] Trying to get into the advanced stuff
Whoa, thanks! :D Now I only need to program a DLL to do the sorting. :)
EDIT: Just for the sake of correctness: it's LVN_COLUMNCLICK instead of LVN_COLUMNCLICKED. ;)

This post was edited on 06-10-2007 at 03:39 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-10-2007 03:36 PM
Profile E-Mail PM Web Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: [?] Trying to get into the advanced stuff
quote:
Originally posted by Mattike
Whoa, thanks! :D Now I only need to program a DLL to do the sorting. :)
EDIT: Just for the sake of correctness: it's LVN_COLUMNCLICK instead of LVN_COLUMNCLICKED. ;)

Why do you need a dll to do the sorting? That's also possible with JScript, even with custom sort orders via a callback function.
06-10-2007 04:03 PM
Profile PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« 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