Files
santifer--career-ops/dashboard/open_windows.go
T
wehub-resource-sync d083df1fdb
CodeQL Analysis / Analyze (javascript-typescript) (push) Failing after 2s
Web CI / web typecheck + build (push) Failing after 1s
Release Please / release-please (push) Failing after 1s
CodeQL Analysis / Analyze (go) (push) Failing after 16s
chore: import upstream snapshot with attribution
2026-07-13 12:02:43 +08:00

22 lines
503 B
Go

//go:build windows
package main
import "golang.org/x/sys/windows"
type shellExecuteFunc func(windows.Handle, *uint16, *uint16, *uint16, *uint16, int32) error
var shellExecute = shellExecuteFunc(windows.ShellExecute)
func openWithDefaultApp(target string) error {
verb, err := windows.UTF16PtrFromString("open")
if err != nil {
return err
}
file, err := windows.UTF16PtrFromString(target)
if err != nil {
return err
}
return shellExecute(0, verb, file, nil, nil, windows.SW_SHOWNORMAL)
}