C# Class WindowsContextTracker.Helpers.ScreenshotChangedTracker

A helper class that tracks a users changes. If at least one of the following conditions applies, the new screenshot is also being processed. Otherwise, it is deleted and the tracker waits for the next interval's screenshot. The conditions are: - A change is if the user changes the window/programe he is using. - A change is if the user types some text (above a threshold). - A change is if the user scrolls through text (above a threshold).
显示文件 Open project: sealuzh/PersonalAnalytics Class Usage Examples

Public Methods

Method Description
GetProcessName ( ) : string

This method gets the foreground window and returns the process name if available. (also used to store OCR info)

GetWindowText ( ) : string

This method gets the foreground window and returns the window title if available. (also used to store OCR info)

ScreenshotChangedTracker ( ) : System

register mouse & keyboard events

WindowChanged ( ) : bool

Private Methods

Method Description
ChangeAsOfMajorClicking ( ) : bool

Change if user clicked more than threshold

ChangeAsOfMajorScrolling ( ) : bool

Change if user scrolled more than threashold

ChangeAsOfMajorTyping ( ) : bool

Change if user typed more than threshold

ChangeAsOfWindowChanged ( ) : bool

Change if window changed

GetForegroundWindow ( ) : IntPtr
GetProcessName ( uint processId ) : string

Returns the name of the current process, given the id of the process

GetWindowText ( IntPtr hWnd, StringBuilder lpString, int nMaxCount ) : int
GetWindowText ( IntPtr hwnd ) : string

Gets the window title

GetWindowTextLength ( IntPtr hWnd ) : int
GetWindowThreadProcessId ( IntPtr hWnd, uint &lpdwProcessId ) : uint
IsWindow ( IntPtr hWnd ) : bool
KeyboardListener_KeyDown ( object sender, KeyEventArgs e ) : void

sums up the number of keystrokes within a time interval

MouseListener_MouseClicking ( object sender, MouseEventArgs e ) : void

sums up the mouse clicks within a time interval

MouseListener_MouseScrolling ( object sender, MouseEventArgs e ) : void

sums up the distance scrolled within a time interval

ResetVariables ( ) : void

Reset everything to track for next interval

Method Details

GetProcessName() public method

This method gets the foreground window and returns the process name if available. (also used to store OCR info)
public GetProcessName ( ) : string
return string

GetWindowText() public method

This method gets the foreground window and returns the window title if available. (also used to store OCR info)
public GetWindowText ( ) : string
return string

ScreenshotChangedTracker() public method

register mouse & keyboard events
public ScreenshotChangedTracker ( ) : System
return System

WindowChanged() public method

public WindowChanged ( ) : bool
return bool