Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
About dialog box call
#1
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.
Reply
#2
If you just need the directory then use _SELECTFOLDERDIALOG$.
Reply
#3
(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.
Reply
#4
very handy stuff, i made file and path dialogs with vb for dos to enhance batch files back in 90's
b = b + ...
Reply
#5
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...
Reply




Users browsing this thread: 2 Guest(s)