Windows Monitoring


Events:

Default type: "WINMON"

-----------------------------------------
Events ID: CHANGE_ACTIVE

Event Value: handle to new active window
Ext parameter 1: Window title
Ext parameter 2: Short window title (application name)
Ext parameter 3: Process executable filename w/o ext

NOTE: Use WinMon.StartManual("CHANGE_ACTIVE") / WinMon.StartManual("CHANGE_ACTIVE")
to Enable / Disable monitoring active window.

Example:

my_grp = Group( Enabled ){
OnGroupEnable(){ WinMon.StartManual( "CHANGE_ACTIVE" ) }
ChangeActive = Hook( "WINMON", "CHANGE_ACTIVE", Enabled, Break ){
TTS( "TEXT", @2 ) # Speak active window title
}
}

-----------------------------------------
Events ID: DESKLOCK, DESKUNLOCK

NOTE: Use WinMon.StartManual("DESK_MON") / WinMon.StartManual("DESK_MON")
to Enable / Disable desktop monitoring.

-----------------------------------------
Events ID: <PresetName>_CREATE
_ACTIVATE
_CLOSE
_TITLE
_MOVESIZE
_MAXIMIZE
_MINIMIZE
_RESTORE
_FOCUS
_SHOWMINNOACTIVE

NOTE: Use EventSetup to define window detect method.

NOTE: Use WinMon.StartPreset(<PresetName>) / WinMon.StopPreset(<PresetName>)
to Enable / Disable monitoring for specified window.

Example:

my_grp = Group( Enabled ){
OnGroupEnable(){ WinMon.StartPreset( WINAMP ) }
Winamp_Activate = Hook( "WINMON", "WINAMP_ACTIVATE", Enabled ){
OSD( "Winamp" )
}
Winamp_Title = hook( "WINMON", "WINAMP_TITLE", Enabled ){
OSD( "New Winamp title: %s", @1 )
}
}


Actions:

WinMon.ActionPreset( <PresetName> )
- returns window handle (HWND) for specified window,
@1 = window title
@2 = class name

Use ActionSetup to define window detect method.

NOTE: <PresetName> and settings for events and actions may be same.

Example:

DispRemote = Hook( "REMOTE", "DISPLAY", Enabled, Break ){
Break( DispRemote <> 0 )
h = WinMon.ActionPreset( Winamp )
Break( h = 0 )
OSD( @1 )
}

----------------------------------
WinMon( <PresetName> | <Handle>, "<ClassName>" [, "<Text>"])
- returns window handle (HWND) of children window control (like button)
<PresetName> or <Handle> specifies parent window

Examples:

PlayRemote = Hook( "REMOTE", "PLAY", Enabled, Break ){
Break( PlayRemote <> 0 )
h = WinMon( "WinDVD", "Button", "Play" )
Break( h = 0 )
WinCtrl( "BM_CLICK", h )
OSD.ActionPreset( Play )
}


PauseRemote = Hook( "REMOTE", "PAUSE", Enabled, Break ){
Break( PauseRemote <> 0 )
h = WinMon.ActionPreset( WinDVD )
h = WinMon( h, "Button", "Pause" )
Break( h = 0 )
WinCtrl( "BM_CLICK", h )
OSD.ActionPreset( Pause )
}