MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Window_OpenFileDialog

Function Window_OpenFileDialog

src/Window_OS2.c:535–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

533}
534
535cc_result Window_OpenFileDialog(const struct OpenFileDialogArgs* args) {
536
537 HWND hDialog;
538
539 WinSetVisibleRegionNotify(hwndClient, FALSE);
540 memset(&fileDialog, 0, sizeof(FILEDLG));
541 fileDialog.cbSize = sizeof(FILEDLG);
542 fileDialog.fl = FDS_OPEN_DIALOG | FDS_CENTER | FDS_HELPBUTTON;
543 fileDialog.pszTitle = (PSZ)args->description;
544 //fileDialog.pfnDlgProc = myFileDlgProc;
545
546 strcpy(fileDialog.szFullFile, *(args->filters));
547 hDialog = WinFileDlg(HWND_DESKTOP, hwndFrame, &fileDialog);
548
549 if (fileDialog.lReturn == DID_OK) {
550 cc_string temp = String_FromRaw(fileDialog.szFullFile, CCHMAXPATH);
551 args->Callback(&temp);
552 }
553 WinSetVisibleRegionNotify(hwndClient, TRUE);
554 return 0;
555}
556
557cc_result Window_SaveFileDialog(const struct SaveFileDialogArgs* args) {
558 FILEDLG fileDialog;

Callers 3

Calls 1

String_FromRawFunction · 0.85

Tested by

no test coverage detected