- 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; *filename = '\0';
- of.nMaxFile = sizeof(filename);
- of.lpstrFileTitle = NULL;
- of.lpstrInitialDir = NULL;
- of.lpstrTitle = "Select Public Key File";
- of.Flags = 0;
- if (GetOpenFileName(&of)) {
- add_keyfile(filename);
- }
- SendDlgItemMessage(hwnd, 100, LB_RESETCONTENT, 0, 0);
- for (key = first234(rsakeys, &e); key; key = next234(&e)) {
- SendDlgItemMessage (hwnd, 100, LB_ADDSTRING,
- 0, (LPARAM) key->comment);
- }
- SendDlgItemMessage (hwnd, 100, LB_SETCURSEL, (WPARAM) -1, 0);