Example #1
0
func (b *FileBuilder) load() (string, error) {
	d := openfile(w32.OFN_FILEMUSTEXIST, b)
	if w32.GetOpenFileName(d.opf) {
		return d.Filename(), nil
	}
	return "", err()
}
Example #2
0
func ShowOpenFileDlg(parent Controller, title, filter string, filterIndex uint, initialDir string) (filePath string, accepted bool) {
	buf := make([]uint16, 1024)
	ofn := genOFN(parent, title, filter, filterIndex, initialDir, buf)

	if accepted = w32.GetOpenFileName(ofn); accepted {
		filePath = syscall.UTF16ToString(buf)
	}

	return
}