I have a
modeless
dialog box with a
listview
.
Listview
has following styles/extended styles:
LVS_EX_FULLROWSELECT
,
LVS_EX_GRIDLINES
,
LVS_EX_DOUBLEBUFFER
and
LVS_REPORT
.
Dialog's background is a
bitmap image.
Listview
has transparent background and transparent text's background and this is set with the call to following APIs:
ListView_SetTextBkColor( hwndListView, CLR_NONE );
and
SendMessage( hwndListView, LVM_SETBKCOLOR, (WPARAM)0, (LPARAM)CLR_NONE );
Here is the small screenshot of how it looks:
http://pbrd.co/1dTbKbk[
^]
The problem manifests when I vertically scroll the
listview
-its client area is not repainted properly:
http://pbrd.co/1dTbSrw[
^]
I have used the following code to solve this:
case WM_NOTIFY:
if( ( (LPNMHDR)lParam )->idFrom == IDC_LIST1 )
if( ( (LPNMHDR)lParam )->code == LVN_ENDSCROLL ||
( (LPNMHDR)lParam )->code == LVN_BEGINSCROLL )
InvalidateRect( ((LPNMHDR)lParam)->hwndFrom, NULL, TRUE );
return TRUE;
But the problem remains when user clicks on an item, and moves up/down
with the keyboard arrows.
Also, picture in the
listview
's client area sometimes "jumps up" and then repositions properly, during the repaint, if I scroll
using mouse wheel.
I have searched online for a solution but have failed so I ask this:
What is the proper way to handle
listview
's scrolling so I can fix this problem?
Thank you.
Best regards.