Click here to Skip to main content
15,917,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: TreeCtrl & SetitemData Pin
peterchen16-Jan-03 23:26
peterchen16-Jan-03 23:26 
GeneralRe: TreeCtrl & SetitemData Pin
jeremysay16-Jan-03 23:39
jeremysay16-Jan-03 23:39 
GeneralRe: TreeCtrl & SetitemData Pin
jeremysay16-Jan-03 23:51
jeremysay16-Jan-03 23:51 
QuestionAny ideas on updating CListCtrl icon in separate thread ? Pin
Miroslav Rajcic16-Jan-03 21:56
Miroslav Rajcic16-Jan-03 21:56 
AnswerRe: Any ideas on updating CListCtrl icon in separate thread ? Pin
Hesham Amin16-Jan-03 22:19
Hesham Amin16-Jan-03 22:19 
GeneralRe: Any ideas on updating CListCtrl icon in separate thread ? Pin
Miroslav Rajcic16-Jan-03 22:25
Miroslav Rajcic16-Jan-03 22:25 
GeneralRe: Any ideas on updating CListCtrl icon in separate thread ? Pin
Hesham Amin17-Jan-03 2:44
Hesham Amin17-Jan-03 2:44 
AnswerRe: Any ideas on updating CListCtrl icon in separate thread ? Pin
peterchen17-Jan-03 0:20
peterchen17-Jan-03 0:20 
You will probably need to "batch" the updates (e.g. load 10 icons, then update) anyway. Then, PostMessage is not an issue.

You could call InvalidateRect from the worker thread, causing a new LVN_GETDISPINFO in the main thread (and they'd batch nicely). However, I see no chance to get the icon rect without stalling the main thread. You might use this for better prformance if the list is in Report Mode, though. (You need to invalidate the entire icon "column")

I'm not sure if you need to set call SetImageList again after adding icons to it. Just try it, and don't if you don't need to.

You probably need to keep a separate tracking file / icon, and track which icons are already loaded.
in the LVN_GETDISPINFO handler, specify an empty / dummy icon id when it's not yet loaded.

To prioritize:
Share a variable iNextFileIndexToProcess, between the two threads, indicating the index in the list of the file who's icon is next to load. If an icon is already loaded, just skip to the next. If you arrive at the end of the list, start with the first one again. (You need a separate indicator that you have loaded all icons. e.g. break on iIconsLoaded == iFilesInList)

Add a handler for WM_HSCROLL, where you set the iNextFileIndexToProcess to the first displayed item (LVM_GETTOPINDEX)

This is just a rough outline, but I believe it's good Wink | ;)



Those who not hear the music think the dancers are mad.  [sighist] [Agile Programming]
GeneralRe: Any ideas on updating CListCtrl icon in separate thread ? Pin
Miroslav Rajcic17-Jan-03 1:31
Miroslav Rajcic17-Jan-03 1:31 
Questionhow to attach the htmlhelp to an exisiting application Pin
lbc16-Jan-03 21:40
lbc16-Jan-03 21:40 
AnswerRe: how to attach the htmlhelp to an exisiting application Pin
chepuri_uk16-Jan-03 21:58
chepuri_uk16-Jan-03 21:58 
GeneralRe: how to attach the htmlhelp to an exisiting application Pin
lbc16-Jan-03 23:48
lbc16-Jan-03 23:48 
GeneralMore than 1 Doc with CWinApp::OpenDocumentFile(lpszFileName)... Pin
Raphael Kindt16-Jan-03 21:38
Raphael Kindt16-Jan-03 21:38 
GeneralCompilation error Pin
Rage16-Jan-03 21:33
professionalRage16-Jan-03 21:33 
GeneralRe: Compilation error Pin
xxhimanshu16-Jan-03 22:02
xxhimanshu16-Jan-03 22:02 
GeneralRe: Compilation error Pin
Rage16-Jan-03 23:17
professionalRage16-Jan-03 23:17 
GeneralRe: Compilation error Pin
jhwurmbach17-Jan-03 2:22
jhwurmbach17-Jan-03 2:22 
GeneralRe: Compilation error Pin
Rage17-Jan-03 4:02
professionalRage17-Jan-03 4:02 
GeneralEdit At Design-time Pin
chepuri_uk16-Jan-03 20:38
chepuri_uk16-Jan-03 20:38 
GeneralRe: First visible character in a CEdit? Pin
xxhimanshu16-Jan-03 20:45
xxhimanshu16-Jan-03 20:45 
Generalport scanning!!!! Pin
xxhimanshu16-Jan-03 18:38
xxhimanshu16-Jan-03 18:38 
GeneralRe: port scanning!!!! Pin
Stefan Pedersen16-Jan-03 19:26
Stefan Pedersen16-Jan-03 19:26 
GeneralRe: port scanning!!!! Pin
xxhimanshu16-Jan-03 20:25
xxhimanshu16-Jan-03 20:25 
GeneralRe: port scanning!!!! Pin
carrie16-Jan-03 20:58
carrie16-Jan-03 20:58 
GeneralShow my dialog outside the Win2k "locked" screen... Pin
JoeZhang16-Jan-03 18:35
JoeZhang16-Jan-03 18:35 

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.