WindowMessage plugin

Plugin=WindowMessagePlugin can be used to send and receive information from other applications. It can send window messages to other applications and show the result. For example, the plugin can be used to control WinAmp or some similar media players.

Options

General measure options
All general measure options are valid.
WindowName
The name of the window. This is used to identify the window. It's not necessary to set this if the WindowClass is set.
WindowClass
The class of the window. This is used to identify the window. It's not necessary to set this if the WindowName is set.
WindowMessage
This is the message to be send to the window. You need to define 3 parameters to where the first one is the message and the next ones are wParam and lParam. Both wParam and lParam are unsigned decimal integers. The measure returns the value returned by the SendMessage API function. If the WindowMessage is not given, the measure returns the window's current title.

Bangs

Messages can also be sent on demand with the !CommandMeasure bang. The arguments are similar that of the WindowMessage option. !CommandMeasure "MeasureName" "SendMessage Msg wParam lParam"

Examples

The following example returns the name of the song that is playing in WinAmp.

[MeasureWinamp]
Measure=Plugin
Plugin=WindowMessagePlugin
WindowClass=Winamp v1.x
Substitute="[Paused]":""," - Winamp":""

Check if Winamp is playing, or not. The following example returns 0 if it's not playing, 1 if it is playing, and 3 if it's paused.

[MeasureWinampPlaying]
Measure=Plugin
Plugin=WindowMessagePlugin
WindowClass=Winamp v1.x
WindowMessage=1024 0 104

Show song progress. In the following example, the [MeasureWinampDuration] will return the current song position as a value between 0 and 1. Then you can use the Bar meter to display the value.

[MeasureWinampFull]
Measure=Plugin
Plugin=WindowMessagePlugin
WindowClass=Winamp v1.x
WindowMessage=1024 1 105
[MeasureWinampCurr]
Measure=Plugin
Plugin=WindowMessagePlugin
WindowClass=Winamp v1.x
WindowMessage=1024 0 105
[MeasureWinampDuration]
Measure=Calc
Formula=(MeasureWinampCurr<=0)?0:(MeasureWinampCurr/(MeasureWinampFull*1000+1))