Exemplo n.º 1
0
func ShowBrowseFolderDlg(parent Controller, title string) (folder string, accepted bool) {
	var bi w32.BROWSEINFO
	bi.Owner = parent.Handle()
	bi.Title = syscall.StringToUTF16Ptr(title)
	bi.Flags = w32.BIF_RETURNONLYFSDIRS | w32.BIF_NEWDIALOGSTYLE

	w32.CoInitialize()
	ret := w32.SHBrowseForFolder(&bi)
	w32.CoUninitialize()

	folder = w32.SHGetPathFromIDList(ret)
	accepted = folder != ""
	return
}
Exemplo n.º 2
0
func setAppDataPath() {

	const CSIDL_PERSONAL = 5
	var pid uintptr
	hResult := win.SHGetSpecialFolderLocation(0, CSIDL_PERSONAL, &pid)
	AppDataPath = w32.SHGetPathFromIDList(pid)
	if hResult == 0 || AppDataPath == "" {

		AppDataPath = PgmPath
		CopyAppData = false

	} else {
		EKSname = path.Dir(AppDataPath)
		GameName := path.Base(AppDataPath)
		AppDataPath = path.Join(AppDataPath, EKSname, GameName)
		os.MkdirAll(AppDataPath, os.ModeDir)
		CopyAppData = true
	}

}