+ case IDC3_PKEDIT:
+ if (HIWORD(wParam) == EN_CHANGE)
+ GetDlgItemText (hwnd, IDC3_PKEDIT, cfg.keyfile,
+ sizeof(cfg.keyfile)-1);
+ break;
+ case IDC3_PKBUTTON:
+ /*
+ * FIXME: this crashes. Find out why.
+ */
+ 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 Public Key File";
+ of.Flags = 0;
+ if (GetOpenFileName(&of)) {
+ strcpy(cfg.keyfile, filename);
+ SetDlgItemText (hwnd, IDC3_PKEDIT, cfg.keyfile);
+ }
+ break;