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.
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
> 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
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
> 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...
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();
}
*******************
"David Lowndes" <dav...@example.invalid> wrote in message
news:9it6615ql1bk6p1uf...@4ax.com...
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
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();
> 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!
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!
Thanks for the (fix_grid) optimization tip - works great!
Carl
Napalm