HIWORD(wParam) == BN_DOUBLECLICKED))) {
OPENFILENAME of;
char filename[FILENAME_MAX];
- int ret;
memset(&of, 0, sizeof(of));
-#ifdef OPENFILENAME_SIZE_VERSION_400
- of.lStructSize = OPENFILENAME_SIZE_VERSION_400;
-#else
- of.lStructSize = sizeof(of);
-#endif
of.hwndOwner = dp->hwnd;
if (ctrl->fileselect.filter)
of.lpstrFilter = ctrl->fileselect.filter;
filename[lenof(filename)-1] = '\0';
of.nMaxFile = lenof(filename);
of.lpstrFileTitle = NULL;
- of.lpstrInitialDir = NULL;
of.lpstrTitle = ctrl->fileselect.title;
of.Flags = 0;
- if (ctrl->fileselect.for_writing)
- ret = GetSaveFileName(&of);
- else
- ret = GetOpenFileName(&of);
- if (ret) {
+ if (request_file(NULL, &of, FALSE, ctrl->fileselect.for_writing)) {
SetDlgItemText(dp->hwnd, c->base_id + 1, filename);
ctrl->generic.handler(ctrl, dp, dp->data, EVENT_VALCHANGE);
}
{
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);
}
/*