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
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
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


Possibly Related Threads…
Thread Author Replies Views Last Post
  file.. open dialog window pmackay 2 407 08-31-2025, 11:27 PM
Last Post: pmackay
  Multiple Text Box Issues for a Beginner Vespin 11 1,622 10-30-2024, 05:32 PM
Last Post: Vespin
  Dialog box with Time out. ? ahenry3068 5 1,162 07-26-2024, 04:24 PM
Last Post: hsiangch_ong
  control characters in Change dialog box digitalmouse 10 1,868 05-09-2024, 02:17 AM
Last Post: digitalmouse
  Screen Saver Function Call eoredson 10 1,701 01-02-2023, 04:55 AM
Last Post: eoredson

Forum Jump:


Users browsing this thread: 1 Guest(s)