quote:
Originally posted by SpunkyLoveMuff
do you mean send it to the typing area before sending it?
Well, if that is what he wants, this is the code:
code:
//This function requires 2 parameters, a ChatWnd object and a message string
function sendMsg(Wnd, msg) {
//When there's no chatwindow specified, set it to the 1st open window
if (typeOf(Wnd) == "undefined") {
var e = new Enumerator(Messenger.CurrentChats);
Wnd = e.item();
}
//When no message is defined, set it to something else
if (typeOf(msg) == "undefined") msg = "Lemons";
//Save the current edit text
var editText = Wnd.EditText;
//Set the window's edit text to the message
Wnd.EditText = msg;
//Send the message
Wnd.SendMessage(msg);
//Reset the edit text
Wnd.EditText = editText;
}
//You can then use it in any function, like the MenuClicked event
function OnEvent_MenuClicked(Id, Location, OriginWnd) {
if (Id == "MnuSendMsg" && Location == 2) {
sendMsg(OriginWnd, "I clicked the menu in the chatwindow!");
} else {
sendMsg(OriginWnd, "I clicked the menu in the contact list!");
}
}
But I still have no idea why you should want to see the message before it's sended.
quote:
Originally posted by SpunkyLoveMuff
Mattike - you got there before me
Belgian speed mate.