process

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROCESS_QUERY_INFORMATION = 0x0400
	PROCESS_VM_READ           = 0x0010
)

Variables

This section is empty.

Functions

func GetExecutableFromHandle

func GetExecutableFromHandle(hWnd uintptr) (string, error)

GetExecutableFromHandle tries to get the (short) executable name of a window given the window handle.

Returns either the Executable as a string or an error if the executable could not be found.

func GetExecutableFromPID

func GetExecutableFromPID(pid uint32) (string, error)

GetExecutableFromPID functions like GetFullExectuableFromPID but returns only the executable's name. E.g Program.exe

For more information, see GetFullExecutableFromPID.

Returns either the Executable as a string or an error if the executable could not be found.

func GetFullExecutableFromPID

func GetFullExecutableFromPID(pid uint32) (string, error)

GetFullExecutableFromPID tries to get the full path of the executable of a process with the given PID (Process ID). E.g. C:/Applications/Program.exe

Returns either the Executable as a string or an error if the executable could not be found.

func GetProcessIDByExecutable

func GetProcessIDByExecutable(executable string) (uint32, error)

GetProcessIDByExecutable tries to find the PID (Process ID) of a process with the given executable.

Returns either the PID as a uint32 or an error if no PID could be found.

func GetProcessIDFromWindow

func GetProcessIDFromWindow(hWnd uintptr) (uint32, error)

GetProcessIDFromWindow tries to find the PID (Process ID) of a process with the given window handle.

Returns either the PID as a uint32 or an error if no PID could be found.

Types

type Win32_Process

type Win32_Process struct {
	ProcessID uint32
	Name      string
}

Win32_Process WMI class structure

Jump to

Keyboard shortcuts

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