Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LVS_EX_GRIDLINES style is having probem when ComCtl32.dll version 6 is used

136 views
Skip to first unread message

Dave

unread,
Apr 17, 2005, 10:14:23 PM4/17/05
to
I am having the same problem 2 1/2 years after Mike's original post.
Anyone know of a solution?

Thanks for the help!

Dave

On Dec 6 2002, 5:11 pm "Mike Lanski" <dimas...@hotmail.com> wrote in
message
news:04e601c29d85$160babb0$d2f82ecf@TK2MSFTNGXA09...
> I have a list control that has LVS_EX_GRIDLINES style
> set. The problem is when the user clicks on the down or
> up arrow of the scroll bar in the list control the grid
> lines are getting drawn over the items. This messes up
> the whole list control display. This behavior is there
> only when I include the manifest file in the
> application's resource file. This is done to enable my
> application to use ComCtl32.dll version 6. If I take out
> the manifest from the resource it works fine. I would
> really appreciate if any one can help me find a fix for
> this problem.

David Lowndes

unread,
Apr 18, 2005, 2:53:40 AM4/18/05
to
>I am having the same problem 2 1/2 years after Mike's original post.
>Anyone know of a solution?

Dave,

As far as I know, the only solution is not to use that style with the
V6 controls!

See PSS ID Number: 813791 "BUG: Gridlines for ListControl Are Not
Drawn Correctly Using the LVS_EX_GRIDLINES Style".

Dave Lowndes
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Martin Richter [MVP]

unread,
Apr 18, 2005, 2:59:23 AM4/18/05
to
Hallo David!

> See PSS ID Number: 813791 "BUG: Gridlines for ListControl Are Not
> Drawn Correctly Using the LVS_EX_GRIDLINES Style".

There is another workaround: Disable smooth scrolling!

http://support.microsoft.com/default.aspx?scid=kb;en-us;813791

<quote>
Applications can use the SPI_SETLISTBOXSMOOTHSCROLLING parameter when
calling the SystemParametersInfo function to enable or to disable smooth
scrolling in list-view controls and in list box controls.
</quote>

--
Martin Richter [MVP] WWJD
"In C we had to code our own bugs. In C++ we can inherit them."
FAQ : http://www.mpdvc.de
Samples: http://www.codeguru.com http://www.codeproject.com

David Lowndes

unread,
Apr 18, 2005, 5:06:49 AM4/18/05
to
>> See PSS ID Number: 813791 "BUG: Gridlines for ListControl Are Not
>> Drawn Correctly Using the LVS_EX_GRIDLINES Style".
>
>There is another workaround: Disable smooth scrolling!
>
>http://support.microsoft.com/default.aspx?scid=kb;en-us;813791

Thanks Martin, I wasn't aware of that. It's a pity MS just don't fix
it though, it's not as though they've not known about it for a long
time.

Dave

Martin Richter [MVP]

unread,
Apr 18, 2005, 5:40:04 AM4/18/05
to
Hallo David!

> Thanks Martin, I wasn't aware of that. It's a pity MS just don't fix
> it though, it's not as though they've not known about it for a long
> time.

I totally agree with you!
We are suffering on this bug too. And this posting just forced me to
look again into the online MSDN, I hoped to find the note that a hotfix
is available. So I found the hint of the workaround.

Also I connected MS-Support a view minutes ago and the answer was: There
is no hotfix available!

So I just opened an new bug for it, and I will se what MS will answer to
me. The support guy just queried for more details about this bug and
they tried to contact the guy who wrote this article.
I will let you know...

Carl

unread,
Apr 20, 2005, 5:15:39 PM4/20/05
to

"Martin Richter [MVP]" <martin....@mvps.org> wrote in message
news:d3vviu$e5l$1...@online.de...

Ah, good, Someone else sees this too! this is the first I've seen this
artefact discussed...

my solution was to create a subclass that forces a re-draw when
scrolling...( notice the class name )
and for every listctrl we use, we use this class, or a class inherited from
it...
( IMO the very slight flicker and overhead is well worth not having the
*gridline rendering artefact* )

opinions on this solution?,

at least we dont have to have our customers muck about with control-panel
settings,
or I wonder if we can we programmically atler the setting?

Carl

( the key overides of the clistctrl )
****************
void CListCtrl_fixgrid::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar*
pScrollBar)
{
CListCtrl::OnVScroll(nSBCode, nPos, pScrollBar);
Invalidate();
UpdateWindow();
}
void CListCtrl_fixgrid::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar*
pScrollBar)
{
CListCtrl::OnHScroll(nSBCode, nPos, pScrollBar);
Invalidate();
UpdateWindow();
}
*******************


Alexander Grigoriev

unread,
Apr 23, 2005, 10:36:43 AM4/23/05
to
This is where advantages of open source are...

"David Lowndes" <dav...@example.invalid> wrote in message
news:9it6615ql1bk6p1uf...@4ax.com...

Dave

unread,
Apr 24, 2005, 11:19:37 PM4/24/05
to
Thanks for all the info, folks!

Carl's workaround works fine for me. My experiements show that there is
no need to re-draw on horizontal scroll ... I only observed the bug on
vertical scroll.

I tried calling SystemParametersInfo with
SPI_SETLISTBOXSMOOTHSCROLLING, but in my tests it had no effect. Has
anyone got this to work? Is there a trick to it? If the fWinIni
parameter of SystemParametersInfo is zero, is it supposed to apply just
to the currently running application, or for the entire session?

SPI_GETLISTBOXSMOOTHSCROLLING does work for me, so I modified Carl's
solution to only re-draw if that parameter is set.

Thanks again!

Dave

Martin Richter [MVP]

unread,
Apr 27, 2005, 7:56:20 AM4/27/05
to
Hallo Carl!

No answer for now, but I saw an optimization for your code:

> void CListCtrl_fixgrid::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar*
> pScrollBar)
> {
> CListCtrl::OnVScroll(nSBCode, nPos, pScrollBar);
> Invalidate();
> UpdateWindow();
> }
> void CListCtrl_fixgrid::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar*
> pScrollBar)
> {
> CListCtrl::OnHScroll(nSBCode, nPos, pScrollBar);
> Invalidate();
> UpdateWindow();
> }

Because the error only occurs when the mouse is used for scrolling the
follwing condition will optimize painting
if ((::GetKeyState(VK_LBUTTON) & 0x8000)!=0)
{
Invalidate();
UpdateWindow();

Martin Richter [MVP]

unread,
Apr 29, 2005, 5:47:28 AM4/29/05
to
Hallo Dave!

> I tried calling SystemParametersInfo with
> SPI_SETLISTBOXSMOOTHSCROLLING, but in my tests it had no effect. Has
> anyone got this to work? Is there a trick to it? If the fWinIni
> parameter of SystemParametersInfo is zero, is it supposed to apply just
> to the currently running application, or for the entire session?

It does not work for me too!
SystemParametersInfo(SPI_SETLISTBOXSMOOTHSCROLLING,0,(PVOID)FALSE,0);

No effect on this bug!

Martin Richter [MVP]

unread,
May 4, 2005, 2:09:03 AM5/4/05
to
Hallo All!!

I recieved an info from MS via the managed newsgroups:

>> Thanks for your reply.
>>
>> Yes, Martin, this bug will not be fixed in a future SP in Windows XP. It
>> will be fixed in Longhorn.
>>
>> I hope the information is able to address your concern.

Very sad!

Carl

unread,
May 4, 2005, 3:05:41 PM5/4/05
to

"Martin Richter [MVP]" <martin....@mvps.org> wrote in message
news:d4o5m5...@news.grutzeck.de...


Thanks for the (fix_grid) optimization tip - works great!
Carl


Roger Roger

unread,
May 8, 2008, 12:56:00 PM5/8/08
to
Just add the LVS_EX_DOUBLEBUFFER extend style with LVS_EX_GRIDLINES and it
fixes the rendering bug.

Napalm

url:http://www.ureader.com/msg/1484143.aspx

0 new messages