This package allows you to get information (process filename) about the currently active (foreground) window.
Note: works only on Windows OS!
To install the package just run:
go get -u github.com/makssof/go-active-processpackage main
import (
"fmt"
ActiveProcess "github.com/makssof/go-active-process"
)
func main() {
activeProcess, err := ActiveProcess.Get()
if err != nil {
fmt.Println(fmt.Errorf("error: %v", err))
} else {
fmt.Println(activeProcess)
}
}The package is open-sourced under the MIT license.
If you will find some error, want to add something or ask a question - feel free to create an issue and/or make a pull request.
Any contribution is welcome.