ActiveProcess

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: MIT Imports: 4 Imported by: 0

README

Go-Active-Process

This package allows you to get information (process filename) about the currently active (foreground) window.

Note: works only on Windows OS!

GoDoc Release License

Content

Installation

To install the package just run:

go get -u github.com/makssof/go-active-process

Usage

package 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)
    }
}

Contribution

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.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GetForegroundWindow, _      = user32.FindProc("GetForegroundWindow")
	GetWindowThreadProcessId, _ = user32.FindProc("GetWindowThreadProcessId")
)

Functions

func Get

func Get() (string, error)

Get returns current foreground window executable name

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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