What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin

[Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin
quote:
Originally posted by deAd
The code I posted works in a similar way to what Plus! describes.
not at all... it will fail in many occasions...
quote:
Originally posted by deAd
However, even without optimization I'd consider it to be better than what markee posted.
it is worse though...


----------------------------





Code which checks upon the registry for StuffPlug's ChatOnly name:
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {

    var sMyChatName = Messenger.MyName;
    var sStuffPlugPath = "HKLM\\SOFTWARE\\iAvatars.com\\StuffPlug\\";
    var oWSH = new ActiveXObject("WScript.Shell");
    try {
        var bStuffPlugEnabled = true;
        var bStuffPlugEnabled = oWSH.RegRead(sStuffPlugPath + "DisabledFor" + Messenger.MyUserId) == 0;
    } catch( e){}
    try {
        if (bStuffPlugEnabled) {
            if (oWSH.RegRead(sStuffPlugPath + Messenger.MyUserId + "\\ChatName") == 1) {
                var sMyChatName = "StuffPlug User";
                var sMyChatName = oWSH.RegRead(sStuffPlugPath + Messenger.MyUserId + "\\szChatName");
            }
        }
    } catch( e){}

    if (Origin !== sMyChatName) {
        // a contact sent the message, so do whatever
    }
}
- will fail if contact has same chat name as user.




Code without checking (maybe version dependant) registry settings:
code:
var aSent = new Array();

function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
    aSent[ChatWnd.Handle] = Message;
}

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
    if (aSent[ChatWnd.Handle] === Message) {
        delete aSent[ChatWnd.Handle];
    } else {
        // a contact sent the message, so do whatever
    }
}

This post was edited on 01-22-2007 at 06:22 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
01-22-2007 04:14 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 01-22-2007 at 03:05 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by deAd on 01-22-2007 at 03:26 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 01-22-2007 at 03:36 AM
RE: RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by deAd on 01-22-2007 at 03:42 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 01-22-2007 at 03:45 AM
RE: RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by deAd on 01-22-2007 at 04:11 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 01-22-2007 at 04:14 AM
RE: RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by deAd on 01-22-2007 at 04:17 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 01-22-2007 at 04:22 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 01-22-2007 at 04:48 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 01-22-2007 at 05:00 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by bigbob85 on 12-14-2007 at 10:49 PM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 12-14-2007 at 11:52 PM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by bigbob85 on 12-15-2007 at 12:16 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 12-15-2007 at 05:16 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by Deco on 12-16-2007 at 11:30 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 12-16-2007 at 01:18 PM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 12-16-2007 at 01:49 PM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by bigbob85 on 12-16-2007 at 10:28 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On