Something I just wrote out. Except it doesn't seem to detect all types of events. Any ideas?
js code:
// WLM Toasts - easily detect Messenger toasts
// By Whiz @ WhizWeb Community (http://www.portal-wwc.org.uk)
// Adapted from "MSN Popup Spy" by ".felipE" (http://felipex.net)
var Popups = []; // empty popup array
MsgPlus.AddTimer("WLMToastSearch", 100); // start a timer
function OnEvent_Timer(TimerId)
{
if (TimerId === "WLMToastSearch")
{
var Popup = Interop.Call("user32", "FindWindowW", "msblpopupmsgwclass", 0); // attempt to find the window
if (Popup && Popups[Popup.Handle] === undefined) // if it exists, and we haven't already dealt with it
{
var Length = Interop.Call("user32", "SendMessageA", Popup, 14, 0, 0); // get the length
var String = ""; // start an empty string
for (var Count = 0; Count < Length; Count++) // for each character of the length
{
String += " "; // add a space
}
Interop.Call("user32", "SendMessageW", Popup, 13, Length + 1, String); // get the actual message
Debug.Trace("New WLM notification: \"" + String.replace(/\n/g, "") + "\" (handle: " + Popup.Handle + ")"); // add a debug message
Popups[Popup.Handle] = String; // store the string and handle so that the toast isn't detected again
// process "String" variable here
}
MsgPlus.AddTimer("WLMToastSearch", 100); // reset the timer
}
}