What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Structure definition class

Structure definition class
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
O.P. RE: List-view groups
At the moment, I implemented some basic types (BOOL, WORD, INT, CHAR, LPWSTR) and some common synonyms (UINT, DWORD, LONG). I also added a POINT type which basically writes an array [x, y] to two INTs.

To define a DataType, you just need to specify its size in bytes and a getter and setter method. For example, INT is defined with size 4 and two methods which simply map to ReadDWORD and WriteDWORD. For LPWSTR, the getter method uses some functions from kernel32 to get the string length of the pointer, then copy its contents and read it. The setter simply creates a DataBloc storing the given string and writes the pointer to that block.

This can still be extended upon though, I'm thinking about adding the possibility to use other StructTypes as DataTypes. For example, a NMLISTVIEW structure has an NMHEADER structure for its first 16 bytes. Instead of redefining the NMHEADER members in the NMLISTVIEW definition, it can be easier to just use NMHEADER as the data type of the first member hdr.

Ultimately, you should be able to just copy-paste the structure definitons from MSDN and rewrite it to produce a valid JavaScript hash with keys and data types. I'm not there yet, but even in this early stage it made my life much easier while working on the new ListView class! :D
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
10-18-2010 11:28 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Structure definition class - by Matti on 10-17-2010 at 08:35 PM
RE: Structure definition class - by Matti on 10-20-2010 at 04:21 PM
RE: Structure definition class - by Matti on 11-07-2010 at 08:12 PM
RE: List-view groups - by Mnjul on 10-17-2010 at 09:07 PM
RE: List-view groups - by Matti on 10-18-2010 at 11:28 AM
RE: List-view groups - by matty on 10-18-2010 at 12:03 PM
RE: List-view groups - by SmokingCookie on 10-18-2010 at 03:30 PM
RE: List-view groups - by Matti on 10-18-2010 at 08:33 PM
RE: List-view groups - by Eljay on 10-18-2010 at 09:16 PM
RE: List-view groups - by Matti on 10-18-2010 at 09:43 PM
RE: List-view groups - by CookieRevised on 10-18-2010 at 11:11 PM


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