View previous topic :: View next topic |
Author |
Message |
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Thu Mar 29, 2007 3:33 pm Post subject: Yeh! Table Element Grouping... |
|
|
1) Anyone know how to handle a LPWSTR type variable? I don't think @BINARY(DWORD,%%var) is correct.
2) Also, what is the proper way to use multiple options for a struct member?
Example:
I need all of these options for the "MASK" member (or at least two of them)
%%LVGF_HEADER = $1
%%LVGF_GROUPID = $10
%%LVGF_ALIGN = $8
I have tried %%MASK = @sum(%%LVGF_HEADER,%%LVGF_GROUPID,%%LVGF_ALIGN)
And
%%MASK = @sum(%%LVGF_HEADER,%%LVGF_GROUPID)
I'm not sure if it is working. However, I might have %%MASK right and it's just my first question that is giving me the problem.
If it helps I'm working with the LVGROUP structure.
StrucTypeDefs:
# UINT cbSize; // 4 bytes
# UINT mask; // 4 bytes
# LPWSTR pszHeader; // ? bytes
# int cchHeader; // 4 bytes
# LPWSTR pszFooter; // ? bytes
# int cchFooter; // 4 bytes
# int iGroupId; // 4 bytes
# UINT stateMask; // 4 bytes
# UINT state; // 4 bytes
# UINT uAlign; // 4 bytes
Code: |
:LVGROUP
%%LVGF_HEADER = $1
%%LVGF_GROUPID = $10
%%LVGF_ALIGN = $8
%%LVGA_FOOTER_CENTER = $10
%%LVGA_FOOTER_LEFT = $8
%%LVGA_FOOTER_RIGHT = $20
%%LVGA_HEADER_CENTER = $2
%%LVGA_HEADER_LEFT = $1
%%LVGA_HEADER_RIGHT = $4
%%cbSize = 40
%%mask = @sum(%%LVGF_HEADER,%%LVGF_GROUPID,%%LVGF_ALIGN)
%%pszHeader = "TEST GROUP"
%%cchHeader = @len(%%pszHeader)
%%pszFooter = 0
%%cchFooter = @len(%%pszFooter)
%%iGroupId = %3
%%stateMask = 0
%%state = $0
%%uAlign = %%LVGA_FOOTER_LEFT
%%LVGROUP = @BINARY(DWORD,%%cbSize)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%mask)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%pszHeader)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%cchHeader)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%pszFooter)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%cchFooter)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%iGroupId)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%statemask)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%state)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%uAlign) |
I actually have groups working for the VDS table element but can't get the group header text to show up.
Thanks in advance,
Aslan
Last edited by Aslan on Thu Mar 29, 2007 8:23 pm; edited 1 time in total |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Mar 29, 2007 7:39 pm Post subject: |
|
|
Sorry Aslan that I have not answered you yet on this. You actually don't need the Wide character strings LPWSTR. Make sure you are sending the ASCII version of the API Messages. Your code is incorrect... See below for the correct way to handle the strings.
Code: |
:LVGROUP
%%LVGF_HEADER = $1
%%LVGF_GROUPID = $10
%%LVGF_ALIGN = $8
%%LVGA_FOOTER_CENTER = $10
%%LVGA_FOOTER_LEFT = $8
%%LVGA_FOOTER_RIGHT = $20
%%LVGA_HEADER_CENTER = $2
%%LVGA_HEADER_LEFT = $1
%%LVGA_HEADER_RIGHT = $4
%%cbSize = 40
%%mask = @sum(%%LVGF_HEADER,%%LVGF_GROUPID,%%LVGF_ALIGN)
%%pszHeader = "TEST GROUP"
%H = %%pszHeader
%%cchHeader = @len(%%pszHeader)
%%pszFooter = 0
%%cchFooter = 0
%%iGroupId = %3
%%stateMask = 0
%%state = $0
%%uAlign = %%LVGA_FOOTER_LEFT
%%LVGROUP = @BINARY(DWORD,%%cbSize)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%mask)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,@Addr("%H"))
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%cchHeader)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%pszFooter)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%cchFooter)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%iGroupId)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%statemask)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%state)
%%LVGROUP = %%LVGROUP@BINARY(DWORD,%%uAlign)
|
_________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Thu Mar 29, 2007 8:17 pm Post subject: |
|
|
BTW- I recently remembered something in a post about how to do Wide character strings. I'm not sure were the post is but I believe Dragonshere you were the one who posted it.
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Mar 29, 2007 8:49 pm Post subject: |
|
|
Aslan,
Your right... I just looked up the LVM_INSERTGROUP and there is no ASCII version of this message. Also there is no ASCII version of the LVGROUP structure so you are correct that you will need to use Wide character strings. Lucky for you that the control seems to handle Big endian Wide characters
Also just so you know GadgetX has a @Ole(VDSTOBSTR) function that will take a VDS string and turn it into a BSTR ie Wide String and return it's memory address that you should be able to use in the structure. Might make it easier.
I have posted several times about Wide character strings and how to convert from a VDS string to a Wide character string. This question started poping up as soon as VDS 5 was released since many API messages and functions use UNICODE/Wide characters or multibyte characters...
_________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Mar 29, 2007 8:54 pm Post subject: |
|
|
Aslan,
BTW you have my permission to include my utils.dsu into your DSU if you like. I don't care about credits or anything like that.
Maybe I will integrate this into my TLibBrowser GadgetX tool for looking up Type Info on OLE controls.
_________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Mar 29, 2007 9:00 pm Post subject: |
|
|
Oh just so you know you would do the same thing for the pszFooter as you did for the header.
_________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Thu Mar 29, 2007 10:13 pm Post subject: |
|
|
Yep that would be the one. Probably my bad choice for the title is what through me off.
I started on this DSU a long time ago and dropped it for a while.
Thanks for permit to incorporate your util.dsu into this one.
I had been planning on combining everything I have learned and others have shared into single DSU for quite some time now.
In fact Shinobi (Where is he anyway?) was helping me with some of it.
Anyway, I'll post a list of what I know I can include so far and if anyone wants to contribute more... please feel free
|
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Fri Mar 30, 2007 3:29 am Post subject: |
|
|
Oh yeah! I am VERY interested in the grouping!!! If a DSU could be made for this it would be great!! I am making an app that I could use this feature!! Please post when it is done. Thanks so much!!
_________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Fri Mar 30, 2007 5:01 am Post subject: |
|
|
Let's see what I can get done this weekend
I might have to make two DSUs;
A pure VDS one and an advanced one that requires Dragonshere's GadgetX.
BTW - for anyone else that might be trying to use the LVGROUP structure, make sure that LVGF_GROUPID is last in the MASK member or the rest won't work.
ie. %%mask = @sum(%%LVGF_HEADER,%%LVGF_ALIGN,%%LVGF_GROUPID)
|
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Fri Mar 30, 2007 5:18 am Post subject: |
|
|
Very cool. Thanks. I could use both.
_________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Tue Apr 03, 2007 6:42 pm Post subject: |
|
|
Ok I've gotten a long way but I'm having trouble with a key issue.
I'm trying to see if I can make use of a subitem being clicked.
My problem is how to put a C struct in a C struct.
Code: |
##################Notes##################
# LVM_SUBITEMHITTEST
# lResult = SendMessage( // returns LRESULT in lResult
# (HWND) hWndControl, // handle to destination control
# (UINT) LVM_SUBITEMHITTEST, // message ID
# (WPARAM) wParam, // = 0; not used, must be zero
# (LPARAM) lParam // = (LPARAM) (LVHITTESTINFO) pInfo; );
#wParam //Must be zero.
#pInfo //Pointer to an LVHITTESTINFO structure.
# typedef struct _LVHITTESTINFO {
# POINT pt;
# UINT flags;
# int iItem;
# int iSubItem;
#} LVHITTESTINFO, *LPLVHITTESTINFO;
#typedef struct tagPOINT {
# LONG x;
# LONG y;
#} POINT, *PPOINT;
#########################################
:Table1CLICK
%X = @MOUSEPOS(X)
%Y = @MOUSEPOS(Y)
%%Point = @BINARY(LARGEINT,%X)@BINARY(LARGEINT,%Y)
#The problem is here; I need to put %%point in %%LVHITTESTINFO
%%LVHITTESTINFO = @BINARY(DWORD,%%Point)@BINARY(DWORD,0)@BINARY(DWORD,0)@BINARY(DWORD,0)
%%LVM_SUBITEMHITTEST = @SENDMSG(@WINEXISTS(~Table1),@SUM($1000,57),0,%%LVHITTESTINFO)
info %%LVM_SUBITEMHITTEST |
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Apr 03, 2007 8:50 pm Post subject: |
|
|
Aslan,
Below is your code corrected.
Code: |
##################Notes##################
# LVM_SUBITEMHITTEST
# lResult = SendMessage( // returns LRESULT in lResult
# (HWND) hWndControl, // handle to destination control
# (UINT) LVM_SUBITEMHITTEST, // message ID
# (WPARAM) wParam, // = 0; not used, must be zero
# (LPARAM) lParam // = (LPARAM) (LVHITTESTINFO) pInfo; );
#wParam //Must be zero.
#pInfo //Pointer to an LVHITTESTINFO structure.
# typedef struct _LVHITTESTINFO {
# POINT pt;
# UINT flags;
# int iItem;
# int iSubItem;
#} LVHITTESTINFO, *LPLVHITTESTINFO;
#typedef struct tagPOINT {
# LONG x;
# LONG y;
#} POINT, *PPOINT;
#########################################
:Table1CLICK
%X = @MOUSEPOS(X)
%Y = @MOUSEPOS(Y)
%%Point = @BINARY(INT,%X)@BINARY(INT,%Y)
#The problem is here; I need to put %%point in %%LVHITTESTINFO
%%LVHITTESTINFO = %%Point@BINARY(DWORD,0)@BINARY(INT,0)@BINARY(INT,0)
%%LVM_SUBITEMHITTEST = @SENDMSG(@WINEXISTS(~Table1),@SUM($1000,57),0,%%LVHITTESTINFO)
info %%LVM_SUBITEMHITTEST
|
_________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Wed Apr 04, 2007 1:16 am Post subject: |
|
|
Thanks Draogonshere,
Unfortunately that didn't work either
Interestingly, (INT) isn't in the VDS helpfile for @BINARY() but, it didn't error either so I guess it must be valid.
I think somehow that %%POINT needs to identified as a single variable because isn't this:
Code: |
%%Point = @BINARY(INT,%X)@BINARY(INT,%Y)
%%LVHITTESTINFO = %%Point@BINARY(DWORD,0)@BINARY(INT,0)@BINARY(INT,0) |
The same as this:
Code: |
%%LVHITTESTINFO = @BINARY(INT,%X)@BINARY(INT,%Y)@BINARY(DWORD,0)@BINARY(INT,0)@BINARY(INT,0) |
Wouldn't the LVHITTESTINFO stuct be treating "@BINARY(INT,%Y)" as one of the flags instead of being part of the Point struct?
Or is (INT) 2 bytes and LVHITTESTINFO treats the first 4 bytes as the Point structure?
Have I confused myself enough
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|