C# Class ACAT.Lib.Core.Utility.WindowActivityMonitor

Monitors the activity of the foreground window and notifies event subscribers if the focues of the active window changes, OR if the focus changes from one control to another inside the active window Also supports a heartbeat where subscribers can be periodically notified of the current focused window/ window element
Afficher le fichier Open project: brlima94/acat-localization

Méthodes publiques

Méthode Description
Dispose ( ) : void

Disposes resources

GetActiveWindowAsync ( ) : void

Asyncrhonously forces an event to be raised regardless of whether focus changed or not

IsDifferent ( AutomationElement ele1, AutomationElement ele2 ) : bool

Compares the two automation elements and returns if they are identical or not

Pause ( ) : void

Pauses the activity monitoring. No events will be raised when paused

Resume ( ) : void

Resumes window activity monitoring.

Start ( ) : bool

Starts activity monitoring

Private Methods

Méthode Description
GetActiveWindow ( ) : void
GetForegroundWindowInfo ( ) : ACAT.Lib.Core.Utility.WindowActivityMonitorInfo
GetProcessForWindow ( IntPtr hwnd ) : Process
_timer_Tick ( object sender, EventArgs e ) : void

The timer function to check the currently focused window and to see if focus changed or not

getActiveWindow ( bool flag = false ) : void
release ( Object syncObj ) : void

Releases the synch object

tryEnter ( Object syncObj ) : bool

Uses Monitor to see if it can enter

Method Details

Dispose() public static méthode

Disposes resources
public static Dispose ( ) : void
Résultat void

GetActiveWindowAsync() public static méthode

Asyncrhonously forces an event to be raised regardless of whether focus changed or not
public static GetActiveWindowAsync ( ) : void
Résultat void

IsDifferent() public static méthode

Compares the two automation elements and returns if they are identical or not
public static IsDifferent ( AutomationElement ele1, AutomationElement ele2 ) : bool
ele1 System.Windows.Automation.AutomationElement first element
ele2 System.Windows.Automation.AutomationElement second element
Résultat bool

Pause() public static méthode

Pauses the activity monitoring. No events will be raised when paused
public static Pause ( ) : void
Résultat void

Resume() public static méthode

Resumes window activity monitoring.
public static Resume ( ) : void
Résultat void

Start() public static méthode

Starts activity monitoring
public static Start ( ) : bool
Résultat bool