コード例 #1
0
ファイル: dlgs_windows.go プロジェクト: sqweek/dialog
func (b *FileBuilder) load() (string, error) {
	d := openfile(w32.OFN_FILEMUSTEXIST, b)
	if w32.GetOpenFileName(d.opf) {
		return d.Filename(), nil
	}
	return "", err()
}
コード例 #2
0
ファイル: commondlgs.go プロジェクト: foxundermoon/gform
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
}