#define DEFAULT_KEYSIZE 1024
-static int requested_help;
-
static char *cmdline_keyfile = NULL;
/*
{
OPENFILENAME of;
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;
if (ppk) {
of.lpstrFilter = "PuTTY Private Key Files (*.ppk)\0*.ppk\0"
*filename = '\0';
of.nMaxFile = FILENAME_MAX;
of.lpstrFileTitle = NULL;
- of.lpstrInitialDir = NULL;
of.lpstrTitle = dlgtitle;
of.Flags = 0;
- if (save)
- return GetSaveFileName(&of);
- else
- return GetOpenFileName(&of);
+ return request_file(NULL, &of, FALSE, save);
}
/*
!import_possible(type)) {
char *msg = dupprintf("Couldn't load private key (%s)",
key_type_to_str(type));
- MessageBox(NULL, msg,
- "PuTTYgen Error", MB_OK | MB_ICONERROR);
+ message_box(msg, "PuTTYgen Error", MB_OK | MB_ICONERROR,
+ HELPCTXID(errors_cantloadkey));
sfree(msg);
return;
}
sfree(comment);
if (ret == 0) {
char *msg = dupprintf("Couldn't load private key (%s)", errmsg);
- MessageBox(NULL, msg, "PuTTYgen Error", MB_OK | MB_ICONERROR);
+ message_box(msg, "PuTTYgen Error", MB_OK | MB_ICONERROR,
+ HELPCTXID(errors_cantloadkey));
sfree(msg);
} else if (ret == 1) {
/*
InitCommonControls();
hinst = inst;
+ hwnd = NULL;
/*
* See if we can find our Help file.