Hello. Welcome to the Forums.
many developers want to make a bot and so far the Plus! API and the Messenger API does not allow you to find out what messages are recieved. how ever this does not mean it's impossible. i suggest looking up on how to hood windows. there was a certain method shown the me by a regular forum'er which executed the code you want.
if i remember it was a GetWindowText call but i cant remember correctly. look at that call some more and maybe some other hooks. google for 'Getting Text from Window API' etc etc. i suggest AllApi.net they provide a detailed page on each API call and even have examples.
i hope you solve your problem