QB64 Phoenix Edition
About dialog box call - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10)
+---- Thread: About dialog box call (/showthread.php?tid=2660)



About dialog box call - eoredson - 05-07-2024

For some time now I have been using the following for dialog box calls from the .DLL MSDN library:

Code: (Select All)
' dialog box
If VarX = -1 Then
  Result = GetOpenFileNameA&&(OpenCall) ' Do Open File dialog call.
End If

If VarX = -2 Then
  Result = GetSaveFileNameA&&(OpenCall) ' Do Save File dialog call.
End If
Although I was unaware they are supported within QB64 as such:

Code: (Select All)
Midi$ = _OpenFileDialog$("Open File", "", "*.mid ", "Midi files", 0)

If _MessageBox("MidiPlay", "Load: " + Midi$, "yesno", "question") = 0 Then Color 7: End
_MessageBox "MidiPlay", "Press <enter> to quit: ", "info"
My real question is if the box call can return filenames, how do I get a name of a folder instead!?

Thanks, Erik.


RE: About dialog box call - a740g - 05-07-2024

If you just need the directory then use _SELECTFOLDERDIALOG$.


RE: About dialog box call - eoredson - 05-08-2024

(05-07-2024, 05:34 AM)a740g Wrote: If you just need the directory then use _SELECTFOLDERDIALOG$.

Thank you! I can now replace all function calls from Line Input Path$ with Path$ = _SelectFolderDialog$ in a dozen places!

Erik.


RE: About dialog box call - bplus - 05-08-2024

very handy stuff, i made file and path dialogs with vb for dos to enhance batch files back in 90's


RE: About dialog box call - eoredson - 05-09-2024

In a project of mine called Qb64shell I wrote my own custom dialog boxes and their list is:

 List of all boxes:
    HelpAbout, BreakBox, QuitBox,
    MessageBox, ErrorBox, HelpBox,
    SearchBox, SearchBox2, ReplaceBox,
    MonitorBox, WhatisBox, HexCalc(HelpBox),
    JumpBox, AppendBox, FilenameBox, AsciiBox.

before I found _MessageBox bundled with QB64...