Hey...I'm in the process of making an WLM add on which will run like an MSN bot. It will have all the commands that an MSN bot will have but the user will also be able to talk to the people on their contact list.
So far i have managed to hook the MSN and add my own sub menu. And i have managed to hook winsock to detect when a message is received. But i'm having a problem trying to send a message. I don't want to use the API because it uses the SendKeys function which is a bit tacky.
I know that the input text box is a windowless rich edit text box and i was wondering how i can actually hook it and input text to it. If thats not possible could someone give me an example of how i could do the same thing with Active Accessibility?
Hey moeur, by containing window i take it you mean the whole conversation window? If so i have managed to hook that already and add a sub menu. But i am unsure of how to send Text to the input box? Is it possible you could point me in the right direction? Thanks.
Wouldn't you just need to spy what messages are going out when you write a message? One of them ought to be the message that contains the outgoing message (a pointer to string or a pointer to structure that contains pointer to string).
I didn't mean that. I meant that by sniffing how the MSN window works you will know what message to send and where to send if such message is outputted from the window elsewhere; and then code based on that. So you don't need to access the richtextbox at all to send text.
Now...the numbers in the MSG section always change even if it is to the same person so how does it know where its going? :s
However, i'm hoping your suggesytion of sniffing the window will tell me exactly what i need to do? It's just i never heard of sniffing another applications actions? :S
Well, I once sniffed how mIRC worked, although differently: I just made the program connect to my own "proxy" program that displayed all the messages mIRC sent and received. I did this to know how the most popular program does traffic handling so I could duplicate the behaviour in my own program to ensure compatibility with most IRC servers.
Anyways, that was just an example. By sniffing what the other program does you can duplicate the behavior. However, I got another suggestion: take a look at MSN client done by Wokawidget, Badger Messenger. I believe you'll find the information you need by taking a look at how that program works.
I don't know how you are going to communicate with the windowless control from outside the program that created the control. Certainly not from VB.
Windowless controls communicate with their container using a two-way system of event firing and exposing methods and properties to the container.
You'll have to investigate the MFC interfaces involved to see if this system can be tapped into via C++. Look up:
COleControl Class
Windowless Controls
IOleInPlaceObjectWindowless