Shoutbox

chat window's history control interaction-advance scripting - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: chat window's history control interaction-advance scripting (/showthread.php?tid=76632)

chat window's history control interaction-advance scripting by mondator on 08-08-2007 at 02:13 PM

How can i interact with the chat window's history control doing things like clear it or clear just the last message or write message without name of his sender or just display message without the name of the sender when a ChatWndReceiveMessage events have been fired.thx for your help and have a nice day(Y)


RE: chat window's history control interaction-advance scripting by matty on 08-08-2007 at 03:15 PM

It isn't possible with scripting alone. While Plus! provides Win32 API functionality I am pretty sure such a feat is impossible via the standalone scripting engine.

You are going to have to do some low level programing within Windows Live Messenger's process pages to get the real handle of the chat history control since each control is wrapped in a DirectUI wrapper. Plus! doesn't even have a /clear command so goodluck with that :P


RE: chat window's history control interaction-advance scripting by mondator on 08-08-2007 at 03:33 PM

that's exactly what i search for how to get the idcontrol using a dll and how use this id to interact with the control.i dont know why it's isnt included like thus interesting fct in plus! knowing we can make a lot of interessting  thing with it.


RE: chat window's history control interaction-advance scripting by matty on 08-08-2007 at 03:41 PM

A handful of people here have the knowledge of hooking the process pages of the application. The publically known way is using ActiveAccessibility but this will only give you the handle to read the contents of the chat history box but it is readonly.

matty's reply to Active Accessibility for incoming messages


RE: chat window's history control interaction-advance scripting by mondator on 08-08-2007 at 03:56 PM

there  function included in plus! return a portion of history HistoryText_GetTextRange readonly


i dont see any useful thing using active Active Accessibility
RE: chat window's history control interaction-advance scripting by matty on 08-08-2007 at 04:05 PM

There are only 3 readonly functions in Plus! to deal with the chat history.

HistoryText_GetTextRange
HistoryText_GetCurSelEnd
HistoryText_GetCurSelStart

None of these will let you clear the chat history. Like I said you are going to have to hook the inner workings of WLM to get the true handle of the rtf box. This is beyond the scope of what a script can offer as far as functionality.

quote:
Originally posted by mondator
i dont see any useful thing using active Active Accessibility
First please don't double post as it is against the forum rules. Instead use the [Image: edit.gif] button to edit your post.

Before the release of Messenger Plus! Live there was no way of reading the conversation without using Active Accessibility.
RE: chat window's history control interaction-advance scripting by mondator on 08-08-2007 at 04:21 PM

sorry and thx for information and please if u have any news or thing can help me please that will very generouse from u to share with me :)


RE: chat window's history control interaction-advance scripting by effection on 08-08-2007 at 11:49 PM

matt im trying to recreate your code in a C++ console application to investigate a bit further and im also interested in this method of hooks :)

ive got this

code:
HWINEVENTHOOK g_hook;

void CALLBACK HandleWinEvent(HWINEVENTHOOK hook, DWORD event, HWND hwnd,
                             LONG idObject, LONG idChild,
                             DWORD dwEventThread, DWORD dwmsEventTime)
{
    printf("called\n");
    IAccessible *pAcc = NULL;
    VARIANT varChild;
    HRESULT hr = AccessibleObjectFromEvent(hwnd, idObject, idChild, &pAcc, &varChild); 
    if ((hr == S_OK) && (pAcc != NULL))
    {
        char *classname;
        classname = (char*)malloc(15);
        GetClassName(GetParent(hwnd),(LPTSTR)classname,14);
        printf("Classname: %s\n", classname);
        if(strcmp(classname,"IMWindowClass") == 0){
            printf("found\n");
        }
   
    }
}

// Initializes COM and sets up the event hook.
//
void InitializeMSAA()
{
    CoInitialize(NULL);
    g_hook = SetWinEventHook(
        EVENT_SYSTEM_ALERT , EVENT_OBJECT_ACCELERATORCHANGE,  // Range of events
        NULL,                                          // Handle to DLL.
        HandleWinEvent,                                // callback.
        0, 0,              // Process and thread IDs of interest (0 = all)
        WINEVENT_SKIPOWNPROCESS); // Flags.
}

int main(array<System::String ^> ^args)
{
    InitializeMSAA();
    printf("init'd\n");
        while(1);
    system("pause");
    return 0;
}

but the "called" is never even printed in the callback, i'm guessing it has something to do with sitting in an infinite loop, what am i supposed to do instead?
RE: RE: chat window's history control interaction-advance scripting by TheSteve on 08-09-2007 at 12:46 AM

quote:
Originally posted by matty
but this will only give you the handle to read the contents of the chat history box but it is readonly.
Actually you can use the put_accValue function to set the text, So if you wanted to clear the text, all you'd have to do is allocate an empty BSTR, and set the text with put_accValue.  Despite the fact that the state on the History control says readonly, that doesn't stop it from being changed from code.
RE: chat window's history control interaction-advance scripting by mondator on 08-12-2007 at 09:21 PM

thx steve but can u be more helpful by chanse i find your post http://forums.fanatic.net.nz/index.php?showtopic=12039 but it doesnt work in devc++ i find a source file for cstring class but i still have some probleme


RE: chat window's history control interaction-advance scripting by TheSteve on 08-15-2007 at 01:54 PM

That sample requires the Microsoft Foundation Classes (MFC) to work correctly. You can try and replace the CString uses with standard C++ strings or perhaps std::string.