Article View: borland.public.cppbuilder.nativeapi
Article #1120Something is missing in the NMLVCUSTOMDRAW struct
From: 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
Technical Details
Message-ID:
<MPG.21896e1eb0f218c5989879@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,8ff79edc31b9843c,start X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Asger Jørgensen <junk@Asger-P.dk> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Something is missing in the NMLVCUSTOMDRAW struct Date: Wed, 24 Oct 2007 15:59:18 +0200 Message-ID: <MPG.21896e1eb0f218c5989879@newsgroups.borland.com> Organization: Asger-P MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit User-Agent: MicroPlanet-Gravity/2.70.2067 NNTP-Posting-Host: 83.73.201.25 X-Trace: newsgroups.borland.com 1193234345 83.73.201.25 (24 Oct 2007 06:59:05 -0700) Lines: 55 Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail