//go:build windows package main import ( "bufio" "context" "encoding/base64" "encoding/binary" "fmt" "os" "os/exec" "path/filepath" "strings" "syscall" "time" "unicode/utf16" ) const nativeDialogs = true const createNoWindow = 0x08000000 // hideConsole stops child console programs (ffmpeg, powershell) from opening // a console window. HideWindow is deliberately not set: Windows would apply // SW_HIDE to the first window the child shows, i.e. the file dialog. func hideConsole(cmd *exec.Cmd) { cmd.SysProcAttr = &syscall.SysProcAttr{CreationFlags: createNoWindow} } func listRoots() []string { mask, _, _ := syscall.NewLazyDLL("kernel32.dll").NewProc("GetLogicalDrives").Call() var roots []string for i := 0; i < 26; i++ { if mask&(1<