+ case IDC_LGFEDIT:
+ if (HIWORD(wParam) == EN_CHANGE)
+ GetDlgItemText (hwnd, IDC_LGFEDIT, cfg.logfilename,
+ sizeof(cfg.logfilename)-1);
+ break;
+ case IDC_LGFBUTTON:
+ memset(&of, 0, sizeof(of));
+#ifdef OPENFILENAME_SIZE_VERSION_400
+ of.lStructSize = OPENFILENAME_SIZE_VERSION_400;
+#else
+ of.lStructSize = sizeof(of);
+#endif
+ of.hwndOwner = hwnd;
+ of.lpstrFilter = "All Files\0*\0\0\0";
+ of.lpstrCustomFilter = NULL;
+ of.nFilterIndex = 1;
+ of.lpstrFile = filename; strcpy(filename, cfg.keyfile);
+ of.nMaxFile = sizeof(filename);
+ of.lpstrFileTitle = NULL;
+ of.lpstrInitialDir = NULL;
+ of.lpstrTitle = "Select session log file";
+ of.Flags = 0;
+ if (GetSaveFileName(&of)) {
+ strcpy(cfg.keyfile, filename);
+ SetDlgItemText (hwnd, IDC_LGFEDIT, cfg.keyfile);
+ }
+ break;
+ case IDC_LSTATOFF:
+ case IDC_LSTATASCII:
+ case IDC_LSTATRAW:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED) {
+ if (IsDlgButtonChecked (hwnd, IDC_LSTATOFF)) cfg.logtype = 0;
+ if (IsDlgButtonChecked (hwnd, IDC_LSTATASCII)) cfg.logtype = 1;
+ if (IsDlgButtonChecked (hwnd, IDC_LSTATRAW)) cfg.logtype = 2;
+ }
+ break;