Dear Seniors,
I would like to know the mechanism in increasing the size of a vertical scroll bar dynamically in my output window.
Ex: I want to take input a file name and display the contents of it. But each time the user inputs a different file name the length of the file changes as well. So length of the scroll bar do changes each time.
Please suggest me a way in implementing the above.
My Approach:
Step-1
------
I have predefined the total number of lines to be display as below
#define MAXLINES 100
Step-2
------
I am using the below in WM_SIZE:
case WM_SIZE:
scrollinfo.nMin = 0;
scrollinfo.nMax = MAXLINES - 1;
SetScrollInfo( hwnd, 0, NUMLINES - 1, &si );
Step-3
------
case WM_PAINT:
step: finding the paint limits;
for( i = PaintBeg; i <= PaintEnd; i++ )
{
using textout function to print a line
}
But the above procedure is fixed to the preassumed predefined macro MAXLINES which is 100 and can only print upto 100 lines but not more.
Language: C ( only ) using win32 api.
Compiler: VC++
Regards,
Kiran.