vtpro

package
v0.0.0-...-2b33715 Latest Latest
Warning

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

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

Documentation

Overview

Package vtpro provides VTPro process management and interaction.

Index

Constants

View Source
const DefaultVTProPath = "C:\\Program Files (x86)\\Crestron\\VtPro-e\\vtpro.exe"

Variables

This section is empty.

Functions

func GetVTProPath

func GetVTProPath() string

GetVTProPath returns the path to the VTPro executable. It checks the VTPRO_PATH environment variable first, falling back to the default installation path if not set.

func ValidateVTProInstallation

func ValidateVTProInstallation() error

ValidateVTProInstallation checks if the VTPro 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 VTPro processes

func NewClient

func NewClient(log logger.LoggerInterface) *Client

NewClient creates a new VTPro client

func (*Client) Cleanup

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

Cleanup ensures VTPro 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 VTPro 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 VTPro 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) HandlePostLoadDialogs

func (c *Client) HandlePostLoadDialogs() error

HandlePostLoadDialogs checks for and dismisses warning dialogs that may appear after file load This includes the "VisionTools(R) Pro-e" warning dialog containing messages like path limitation warnings. This MUST be called BEFORE bringing the window to foreground to ensure dialogs don't interfere.

func (*Client) StartMonitoring

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

StartMonitoring starts a background goroutine that monitors VTPro 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 VTPro main window to appear for a specific process targetPid must be a valid process ID - passing 0 will immediately return failure

func (*Client) WaitForFileLoaded

func (c *Client) WaitForFileLoaded(pid uint32, timeout time.Duration) bool

WaitForFileLoaded waits for VTPro to complete loading the file by monitoring the "VisionTools Pro-e" and "Progress [xx%]" dialogs that appear during file load. Returns true if file loading completed within timeout, false otherwise.

func (*Client) WaitForReady

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

WaitForReady waits for a window to become fully responsive

type VTProProcessAPI

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

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

func NewSimplProcessAPI

func NewSimplProcessAPI(log logger.LoggerInterface) *VTProProcessAPI

func (VTProProcessAPI) FindWindow

func (v VTProProcessAPI) FindWindow(targetPid uint32, debug bool) (uintptr, string)

func (VTProProcessAPI) WaitForReady

func (v VTProProcessAPI) 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