Skip to content

harryjph/go-common-file-dialog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Common File Dialog bindings for Golang

This library contains bindings for Windows Vista and newer's Common File Dialogs, which is the standard system dialog for selecting files or folders to open or save.

The Common File Dialogs have to be accessed via the COM Interface, normally via C++ or via bindings (like in C#).

This library contains bindings for Golang. It does not require CGO, and contains empty stubs for non-windows platforms (so is safe to compile and run on platforms other than windows, but will just return errors at runtime).

This can be very useful if you want to quickly get a file selector in your Golang application. The cfdutil package contains utility functions with a single call to open and configure a dialog, and then get the result from it. Examples for this are in _examples/usingutil. Or, if you want finer control over the dialog's operation, you can use the base package. Examples for this are in _examples/notusingutil.

This library is available under the MIT license.

Currently supported features:

  • Open File Dialog (to open a single file)
  • Open Multiple Files Dialog (to open multiple files)
  • Open Folder Dialog
  • Save File Dialog
  • Dialog "roles" to allow Windows to remember different "last locations" for different types of dialog
  • Set dialog Title, Default Folder and Initial Folder
  • Set dialog File Filters