Let's describe my question as below:
I have created a window using
CreateWindow, and then also created aListviewand EDIT box to show something;hListviewis the handle of the Listview andhEditis the handle of EDIT boxFor now, my program is a single-threaded app;
I have 2 functions void
SetListviewText(): to assign different value toListview's specified item and subitem (theListviewis in report mode);and
void SetEditBoxText(): to append some text to EDIT box, of course, both of them were updated withSendMessage();example,
SetEditBoxText(hEdit, "1111111111111111111111111111111."); SetListviewText(hListview, "Description1",19); Sleep(1000); SetEditBoxText(hEdit, "2222222222222222222222222222222"); SetListviewText(hListview, "Description2",20); SetEditBoxText(hEdit, "33333333333333333333"); Sleep(5000);question,
why I only can get the EDIT box content as:
111111 (
Listviewtext not update now).......1second delay.........
2222222222222(
Listviewtext not update now)3333333333333333(
Listviewtext not update now).......5seconds delay.........
(
Listviewtext update eventually after 6seconds..)Description1
Description2
Why can't the Listview's text be updated together with EDIT box?
PS: If I only put below code in button click case, it's OK to show it immediately.
SetListviewText(hListview, "Description2",20);
Should I use multiple threads? If yes, how?
Thanks in advance.