Well, the easiest thing would be to create all possible Destroyed events and those can then check whether they have been created by that main window and then do something.
Here's an idea:
Javascript code:
// Stores the created window
var oCreatedWnd;
// Array of window IDs in the combo box
var oWndIds = [ "WndOne", "WndTwo", "WndThree" ];
// Creates the new window, pass the main window as parameter
function CreateTheWindow(PlusWnd) {
var nWndId = PlusWnd.Combo_Gombo_GetCurSel("CmbWindow");
if( nWndId < 0 ) return;
var sWndId = oWndIds[nWndId];
oCreatedWnd = MsgPlus.CreateWnd("Interfaces.xml", sWndId);
}
// Destroyed event for WndOne
function OnWndOneEvent_Destroyed(PlusWnd, ExitCode) {
if( PlusWnd === oCreatedWnd ) {
// Change some text and stuff here
}
}
// Repeat for WndTwo, WndThree,...