Make the Event Log scroll down when more things appear on it
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 22 Sep 2000 14:24:27 +0000 (14:24 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 22 Sep 2000 14:24:27 +0000 (14:24 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@618 cda61777-01e9-0310-a592-d414129be87e

windlg.c

index 77db051..6967f4b 100644 (file)
--- a/windlg.c
+++ b/windlg.c
@@ -1579,9 +1579,13 @@ void logevent (char *string) {
     events[nevents] = smalloc(1+strlen(string));
     strcpy (events[nevents], string);
     nevents++;
-    if (logbox)
+    if (logbox) {
+        int count;
        SendDlgItemMessage (logbox, IDN_LIST, LB_ADDSTRING,
                            0, (LPARAM)string);
+       count = SendDlgItemMessage (logbox, IDN_LIST, LB_GETCOUNT, 0, 0);
+       SendDlgItemMessage (logbox, IDN_LIST, LB_SETCURSEL, count-1, 0);
+    }
 }
 
 void showeventlog (HWND hwnd) {