I know you guys hate this kind of questions, but im only asking that cause i couldnt find the answer here at the forum nor at MSDN...
My app is sending messages to add content to a listbox (lb_addstring) but the scroolbar keep always at the top, so the user has to be always scrolling it down to see the more recent messages.
So one solution would be if the new messages would enter the listbox above the old ones, not under it, no idea how to do it.
The other solution would be sending a message to the listbox to scroll down every time a new message is sent. What is this message?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I know you guys hate this kind of questions, but im only asking that cause i couldnt find the answer here at the forum nor at MSDN...
My app is sending messages to add content to a listbox (lb_addstring) but the scroolbar keep always at the top, so the user has to be always scrolling it down to see the more recent messages.
So one solution would be if the new messages would enter the listbox above the old ones, not under it, no idea how to do it.
The other solution would be sending a message to the listbox to scroll down every time a new message is sent. What is this message?
Here you go =)
// Dump string out to list box...
void StatusOut(char *pszMessage, HWND hListBox)
{
// Output the message...
SendMessage(hListBox, LB_ADDSTRING, (WPARAM) -1, (LPARAM) pszMessage);
// Scroll to the bottom...
SendMessage(hListBox, WM_VSCROLL, SB_BOTTOM, 0);
// Repaint window...
UpdateWindow(hListBox);
}
Kip