Thread View: borland.public.cppbuilder.nativeapi
7 messages
7 total messages
Started by Asger Jørgensen
Wed, 24 Oct 2007 13:59
Something is missing in the NMLVCUSTOMDRAW struct
Author: Asger Jørgensen
Date: Wed, 24 Oct 2007 13:59
Date: Wed, 24 Oct 2007 13:59
55 lines
2242 bytes
2242 bytes
Hi there
The NMLVCUSTOMDRAW struct are defined as folows
on the msdn web:
typedef struct tagNMLVCUSTOMDRAW {
NMCUSTOMDRAW nmcd;
COLORREF clrText;
COLORREF clrTextBk;
#if (_WIN32_IE >= 0x0400)
int iSubItem;
#endif
DWORD dwItemType;
RECT rcText;
UINT uAlign;
} NMLVCUSTOMDRAW, *LPNMLVCUSTOMDRAW;
but when I set a watch at rcText I'm told that
it is not a member of NMLVCUSTOMDRAW
i look in commctrl.h and there I see this
typedef struct tagNMLVCUSTOMDRAW
{
NMCUSTOMDRAW nmcd;
COLORREF clrText;
COLORREF clrTextBk;
#if (_WIN32_IE >= 0x0400)
int iSubItem;
#endif
} NMLVCUSTOMDRAW, *LPNMLVCUSTOMDRAW;
I try to fill in the missing part
DWORD dwItemType;
RECT rcText;
UINT uAlign;
so now it dont get the message in the watch list
but there is nothing meaningfull in the RECT.
I can get the left and the right from the nmcd.cr RECT
but I miss the top and bottom, since they are not valid
in the nmcd.cr.
I know I can use ListView_GetItemRect to get the
rect but shouldn't it come with the message.
Is there a special trick to get those ??
If i set ownerdraw = true i get the full itemRect
in the CNDrawItem message but then i dont get
the CDDS_SUBITEM calls in NM_CUSTOMDRAW.
Is ListView_GetItemRect realy the only way ?
Thanks in advance
Asger
Re: Something is missing in the NMLVCUSTOMDRAW struct
Author: Remy Lebeau (TeamB)
Date: Wed, 24 Oct 2007 16:34
Date: Wed, 24 Oct 2007 16:34
68 lines
2917 bytes
2917 bytes
"Asger J�rgensen" <junk@Asger-P.dk> wrote in message
news:MPG.21896e1eb0f218c5989879@newsgroups.borland.com...
> The NMLVCUSTOMDRAW struct are defined as folows
> on the msdn web:
That declaration is not accurate. Look at the actual declaration in
commctrl.h instead:
typedef struct tagNMLVCUSTOMDRAW
{
NMCUSTOMDRAW nmcd;
COLORREF clrText;
COLORREF clrTextBk;
#if (_WIN32_IE >= 0x0400)
int iSubItem;
#endif
#if (_WIN32_WINNT >= 0x501)
DWORD dwItemType;
// Item custom draw
COLORREF clrFace;
int iIconEffect;
int iIconPhase;
int iPartId;
int iStateId;
// Group Custom Draw
RECT rcText;
UINT uAlign; // Alignment. Use LVGA_HEADER_CENTER,
LVGA_HEADER_RIGHT, LVGA_HEADER_LEFT
#endif
} NMLVCUSTOMDRAW, *LPNMLVCUSTOMDRAW;
> but when I set a watch at rcText I'm told that
> it is not a member of NMLVCUSTOMDRAW
Notice in the declaration above that rcText is wrapped inside an #if
statement. _WIN32_WINNT is defined in winresrc.h as 0x500 by default, thus
it does not satisfy the condition of the #if statement unless you re-define
_WIN32_WINNT yourself in the Conditionals list of the Project Options
dialog.
> i look in commctrl.h and there I see this
You must be using an old version of BCB then. The declaration above was
copied from commctrl.h in BCB 6.
> I try to fill in the missing part
> DWORD dwItemType;
> RECT rcText;
> UINT uAlign;
>
> so now it dont get the message in the watch list
> but there is nothing meaningfull in the RECT.
That is because you did not include everything that is missing. As you can
see above, there are 5 other members between dwItemType and rcText that must
be present in order to align rcText correctly in memory.
> Is there a special trick to get those ??
Upgrade to a newer BCB version, or at least download a newer Platform SDK
from Microsoft so you have newer header files.
Gambit
Re: Something is missing in the NMLVCUSTOMDRAW struct
Author: Darko Miletic
Date: Wed, 24 Oct 2007 17:21
Date: Wed, 24 Oct 2007 17:21
7 lines
1341 bytes
1341 bytes
Asger Jørgensen wrote: > Hi there Aparently you are using BCB 5 wihch has old platform sdk. You can get more recent version by downloading and installing bccSDK which is windows 2003 platform sdk prepared for older borland compilers. http://bccsdk.sf.net
Re: Something is missing in the NMLVCUSTOMDRAW struct
Author: Asger Jørgensen
Date: Wed, 24 Oct 2007 20:05
Date: Wed, 24 Oct 2007 20:05
16 lines
1430 bytes
1430 bytes
Hi Darko In article <471f7f00$1@newsgroups.borland.com> darko@uvcms.com Darko Miletic says: > Aparently you are using BCB 5 wihch has old platform sdk. You can get > more recent version by downloading and installing bccSDK which is > windows 2003 platform sdk prepared for older borland compilers. > > http://bccsdk.sf.net Thank You very much Kind regards Asger
Re: Something is missing in the NMLVCUSTOMDRAW struct
Author: Asger Jørgensen
Date: Wed, 24 Oct 2007 21:50
Date: Wed, 24 Oct 2007 21:50
36 lines
2067 bytes
2067 bytes
Hi Remy Lebeau (TeamB) In article <471f7462@newsgroups.borland.com> no.spam@no.spam.com Remy Lebeau (TeamB) says: > unless you re-define _WIN32_WINNT yourself in > the Conditionals list of the Project Options > dialog. Could You tell me exactly how the line in the Conditionals list should look like, I can't seem to get it right. I've added a #define _WIN32_WINNT 0x0502 to the h file but it gives me a warning. > That is because you did not include everything that is missing. As you can > see above, there are 5 other members between dwItemType and rcText that must > be present in order to align rcText correctly in memory. Yes I can see that, but even with the new setup the rcText still just contains crap except for the rcText.width value it contains the ItemIndex, so I gues it's not all right yet..;-) > Upgrade to a newer BCB version, or at least download a newer Platform SDK > from Microsoft so you have newer header files. Yeaa I would like that but the economy is't to that at the moment Thanks for Your help Kind regards Asger
Re: Something is missing in the NMLVCUSTOMDRAW struct
Author: Remy Lebeau (TeamB)
Date: Wed, 24 Oct 2007 22:06
Date: Wed, 24 Oct 2007 22:06
25 lines
1890 bytes
1890 bytes
"Asger J�rgensen" <junk@Asger-P.dk> wrote in message news:MPG.2189dc891ecdaa4698987c@newsgroups.borland.com... > Could You tell me exactly how the line in the > Conditionals list should look like _WIN32_WINNT=0x0501 > I've added a #define _WIN32_WINNT 0x0502 > to the h file but it gives me a warning. Don't do it there. It has to be in the Proect Options in order to be global throughout the project. > Yes I can see that, but even with the new setup > the rcText still just contains crap except for > the rcText.width value it contains the ItemIndex, so > I gues it's not all right yet..;-) Chances are, the OS is not providing those values to begin with. You did not say which OS version you are trying to run this on. Gambit
Re: Something is missing in the NMLVCUSTOMDRAW struct
Author: Asger Jørgensen
Date: Wed, 24 Oct 2007 22:40
Date: Wed, 24 Oct 2007 22:40
19 lines
1394 bytes
1394 bytes
Hi Remy In article <471fc232$1@newsgroups.borland.com> no.spam@no.spam.com Remy Lebeau (TeamB) says: > > _WIN32_WINNT=0x0501 Thanks that was better.:-) > Chances are, the OS is not providing those values to begin with. You did > not say which OS version you are trying to run this on. XP Pro SP 2 Thanks for Your help Kind regards Asger
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads