Click here to Skip to main content
15,911,139 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralListview redraw problems Pin
CaesarCZ5-Jul-02 7:13
CaesarCZ5-Jul-02 7:13 
GeneralRe: Listview redraw problems Pin
Michael Dunn5-Jul-02 8:16
sitebuilderMichael Dunn5-Jul-02 8:16 
GeneralRe: Listview redraw problems Pin
[James Pullicino]5-Jul-02 8:23
[James Pullicino]5-Jul-02 8:23 
GeneralRe: Listview redraw problems Pin
CaesarCZ5-Jul-02 8:40
CaesarCZ5-Jul-02 8:40 
GeneralRe: Listview redraw problems Pin
[James Pullicino]5-Jul-02 8:44
[James Pullicino]5-Jul-02 8:44 
GeneralRe: Listview redraw problems Pin
CaesarCZ5-Jul-02 8:56
CaesarCZ5-Jul-02 8:56 
GeneralRe: Listview redraw problems Pin
[James Pullicino]5-Jul-02 11:06
[James Pullicino]5-Jul-02 11:06 
GeneralRe: Listview redraw problems Pin
CaesarCZ5-Jul-02 12:58
CaesarCZ5-Jul-02 12:58 
when the timer elapses (when an image is loaded actually), this code takes place. It all is a part of the window proc. wParam is the number (array index) of the image to be added. hListBitmap is a initialized image list, hList is a window handle to the listview control, lpPictureList is my class for storing the images

//i tried this line to avoid the flickering, but it dosn't help
SendMessage(m_hList,WM_SETREDRAW,FALSE,0);

//i have and image list with the previous entries already set, so I just add the new one to it
ImageList_Add(hListBitmap, lpPictureList->GetPicture(wParam)->GetThumb(), NULL);
//I assign the image list to the listview
SendMessage(hList, LVM_SETIMAGELIST, (WPARAM)LVSIL_NORMAL, (LPARAM)hListBitmap);
//I add the new item
SendMessage(hList, LVM_SETITEMCOUNT, (WPARAM)1, (LPARAM)LVSICF_NOINVALIDATEALL | LVSICF_NOSCROLL);

LV_ITEM lvItem;

lvItem.mask = LVIF_TEXT | LVIF_IMAGE;
lvItem.pszText = lpPictureList->GetPicture(wParam)->GetFilename();
lvItem.iImage = wParam;
lvItem.iSubItem = 0;
lvItem.cchTextMax = 7;
lvItem.iItem = 0;

SendMessage(hList, LVM_INSERTITEM, 0, (LPARAM)&lvItem);
SendMessage(hList, LVM_SETITEMTEXT, 0, (LPARAM)&lvItem);

//the same as the first line
SendMessage(m_hList,WM_SETREDRAW,TRUE,0);


thanks in advance

GeneralRe: Listview redraw problems Pin
CaesarCZ5-Jul-02 23:45
CaesarCZ5-Jul-02 23:45 
GeneralRe: Listview redraw problems Pin
Shog96-Jul-02 17:11
sitebuilderShog96-Jul-02 17:11 
GeneralRe: Listview redraw problems Pin
CaesarCZ7-Jul-02 0:18
CaesarCZ7-Jul-02 0:18 
GeneralRe: Listview redraw problems Pin
Shog97-Jul-02 8:24
sitebuilderShog97-Jul-02 8:24 
GeneralInet help Pin
5-Jul-02 6:36
suss5-Jul-02 6:36 
GeneralRe: Inet help Pin
Todd Smith5-Jul-02 6:52
Todd Smith5-Jul-02 6:52 
GeneralRe: Inet help Pin
5-Jul-02 6:59
suss5-Jul-02 6:59 
GeneralRe: Inet help Pin
Hanzo25-Oct-02 18:58
Hanzo25-Oct-02 18:58 
QuestionWin32, ATL, WTL or MFC, which route to take? Pin
generic_user_id5-Jul-02 5:51
generic_user_id5-Jul-02 5:51 
AnswerRe: Win32, ATL, WTL or MFC, which route to take? Pin
Michael Dunn5-Jul-02 8:19
sitebuilderMichael Dunn5-Jul-02 8:19 
GeneralRe: Win32, ATL, WTL or MFC, which route to take? Pin
generic_user_id5-Jul-02 11:48
generic_user_id5-Jul-02 11:48 
GeneralRe: Win32, ATL, WTL or MFC, which route to take? Pin
loket5-Jul-02 12:07
loket5-Jul-02 12:07 
GeneralRe: Win32, ATL, WTL or MFC, which route to take? Pin
Michael Dunn5-Jul-02 12:08
sitebuilderMichael Dunn5-Jul-02 12:08 
GeneralRe: Win32, ATL, WTL or MFC, which route to take? Pin
generic_user_id5-Jul-02 23:29
generic_user_id5-Jul-02 23:29 
AnswerRe: Win32, ATL, WTL or MFC, which route to take? Pin
loket5-Jul-02 12:01
loket5-Jul-02 12:01 
GeneralRe: Win32, ATL, WTL or MFC, which route to take? Pin
generic_user_id5-Jul-02 23:34
generic_user_id5-Jul-02 23:34 
GeneralRe: Win32, ATL, WTL or MFC, which route to take? Pin
loket6-Jul-02 1:52
loket6-Jul-02 1:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.