foreground

package module
v0.0.0-...-661cc00 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 2 Imported by: 0

README

go-foreground

go-foreground is a Go package that provides the PID and title of the foreground window on Windows, Linux (X11) and macOS.

Reference Linter Build status

Installation

go get github.com/LightningDev1/go-foreground

Usage

package main

import (
    "fmt"
    "github.com/LightningDev1/go-foreground"
)

func main() {
    pid, _ := foreground.GetForegroundPID()
    title, _ := foreground.GetForegroundTitle()

    fmt.Printf("PID: %d\ntitle: %s\n", pid, title)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetForegroundPID

func GetForegroundPID() (uint32, error)

GetForegroundPID returns the PID of the foreground window.

func GetForegroundTitle

func GetForegroundTitle() (string, error)

GetForegroundTitle returns the title of the foreground window.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL