How to move a scroll bar to the bottom most position?

With this code here:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Create incoming message box
			hEditIn=CreateWindowEx(WS_EX_CLIENTEDGE,
				"EDIT",
				"",
				WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_AUTOVSCROLL|ES_AUTOHSCROLL|//WS_OVERLAPPEDWINDOW|
                WS_VSCROLL,
				50,
                100,
                400,
                120,
                hWnd,
				(HMENU)IDC_EDIT_IN,
				GetModuleHandle(NULL),
				NULL);

			if(!hEditIn)
			{
				MessageBox(hWnd,
					"Could not create incoming edit box.",
					"Error",
					MB_OK|MB_ICONERROR);
			}
			HGDIOBJ hfDefault=GetStockObject(DEFAULT_GUI_FONT);
			SendMessage(hEditIn,
				WM_SETFONT,
				(WPARAM)hfDefault,
				MAKELPARAM(FALSE,0));
			SendMessage(hEditIn,
				WM_SETTEXT,
				NULL,
				(LPARAM)"Message area...");


What would i do to move the scrollbar of the window created to the bottom most position
Last edited on
Nevermind, i solved it with this
1
2
3
4
5
6
7
8
9
SCROLLINFO  holder;
						holder.cbSize = sizeof(holder);
                        holder.fMask = SIF_RANGE;
                        GetScrollInfo(hEditIn,SB_VERT, &holder);
                        holder.cbSize = sizeof(SCROLLINFO);
                        holder.nPos = holder.nMax;
                        holder.fMask = SIF_POS;

                        SetScrollInfo(hEditIn,SB_VERT, &holder, 1);
Well the scrollbar moves, but the edit inside doesnt
You can send a message to editbox like this:
SendMessage(hEditIn,WM_VSCROLL,SB_BOTTOM,NULL);

You won't need to mess about with SCROLLINFO
I can't believe it was that easy, thanks alot.
Topic archived. No new replies allowed.