Use different window procedures for the About box and the Licence box.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 20 Feb 1999 18:12:47 +0000 (18:12 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 20 Feb 1999 18:12:47 +0000 (18:12 +0000)
Should prevent the version string masking part of the licence text ;-)

git-svn-id: svn://svn.tartarus.org/sgt/putty@51 cda61777-01e9-0310-a592-d414129be87e

windlg.c

index b3bfcbf..306ee4f 100644 (file)
--- a/windlg.c
+++ b/windlg.c
@@ -357,6 +357,27 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg,
     return 0;
 }
 
+static int CALLBACK LicenceProc (HWND hwnd, UINT msg,
+                                WPARAM wParam, LPARAM lParam) {
+    switch (msg) {
+      case WM_INITDIALOG:
+       return 1;
+      case WM_COMMAND:
+       switch (LOWORD(wParam)) {
+         case IDOK:
+           abtbox = NULL;
+           DestroyWindow (hwnd);
+           return 0;
+       }
+       return 0;
+      case WM_CLOSE:
+       abtbox = NULL;
+       DestroyWindow (hwnd);
+       return 0;
+    }
+    return 0;
+}
+
 static int CALLBACK AboutProc (HWND hwnd, UINT msg,
                               WPARAM wParam, LPARAM lParam) {
     switch (msg) {
@@ -377,7 +398,7 @@ static int CALLBACK AboutProc (HWND hwnd, UINT msg,
          case IDA_LICENCE:
            EnableWindow(hwnd, 0);
            DialogBox (hinst, MAKEINTRESOURCE(IDD_LICENCEBOX),
-                      NULL, AboutProc);
+                      NULL, LicenceProc);
            EnableWindow(hwnd, 1);
            return 0;
        }