simpl

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package simpl provides SIMPL Windows process management and interaction.

Index

Constants

View Source
const DefaultSimplWindowsPath = "C:\\Program Files (x86)\\Crestron\\Simpl\\smpwin.exe"

Variables

This section is empty.

Functions

func GetSimplWindowsPath

func GetSimplWindowsPath() string

GetSimplWindowsPath returns the path to the SIMPL Windows executable. It checks the SIMPL_WINDOWS_PATH environment variable first, falling back to the default installation path if not set.

func ValidateSimplWindowsInstallation

func ValidateSimplWindowsInstallation() error

ValidateSimplWindowsInstallation checks if the SIMPL Windows executable exists. Returns an error with helpful guidance if the file is not found.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides methods for interacting with SIMPL Windows processes

func NewClient

func NewClient(log logger.LoggerInterface) *Client

NewClient creates a new SIMPL Windows client

func (*Client) Cleanup

func (c *Client) Cleanup(hwnd uintptr, pid uint32)

Cleanup ensures SIMPL Windows is properly closed, with fallback to force termination

func (*Client) FindWindow

func (c *Client) FindWindow(targetPid uint32, debug bool) (uintptr, string)

FindWindow searches for the SIMPL Windows main window belonging to a specific process targetPid must be a valid process ID - passing 0 will return no results

func (*Client) ForceCleanup

func (c *Client) ForceCleanup(hwnd uintptr, knownPid uint32)

ForceCleanup attempts to forcefully close SIMPL Windows using the known PID. It tries two approaches in order: 1. Use hwnd if available (graceful close with PID for force termination) 2. Use known PID (forced termination)

func (*Client) StartMonitoring

func (c *Client) StartMonitoring(pid uint32) func()

StartMonitoring starts a background goroutine that monitors SIMPL Windows dialogs for a specific PID Returns a function to stop the monitoring

func (*Client) WaitForAppear

func (c *Client) WaitForAppear(targetPid uint32, timeout time.Duration) (uintptr, bool)

WaitForAppear waits for the SIMPL Windows main window to appear for a specific process targetPid must be a valid process ID - passing 0 will immediately return failure

func (*Client) WaitForReady

func (c *Client) WaitForReady(hwnd uintptr, timeout time.Duration) bool

WaitForReady waits for a window to become fully responsive

type SimplProcessAPI

type SimplProcessAPI struct {
	// contains filtered or unexported fields
}

SimplProcessAPI is a concrete implementation of the SIMPL process management interface It wraps the Client for backward compatibility with the interface

func NewSimplProcessAPI

func NewSimplProcessAPI(log logger.LoggerInterface) *SimplProcessAPI

func (SimplProcessAPI) FindWindow

func (s SimplProcessAPI) FindWindow(targetPid uint32, debug bool) (uintptr, string)

func (SimplProcessAPI) WaitForReady

func (s SimplProcessAPI) WaitForReady(hwnd uintptr, timeout time.Duration) bool

Jump to

Keyboard shortcuts

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