Jump to content
Sign in to follow this  

msn Conversation window problem.

Recommended Posts


Hello dears,

I am working on an autoresponder for msn.

I need my running script to detect the conversation's window and auto-respond it.

Problem: To make my script detect the msn-conversation's window, I need its title. But every msn contact has his own window title (F.E. Sucker <Sucker@hotmail.com>)

I have used autoit info to take the title, and it gets the same(email). The control ID is not shown(msn's privacy feature).

What I can see with autoit info is the "Class" of the window.

I try to use:

While 1
     If WinExists ("msn-title") then
          controlsend ("msn-title" , "This is an autoresponder. I will talk with you later.")

That "msn-title" is what I seek!

Any help is very appreciated.

Share this post

Link to post
Share on other sites

I believe MSN has its own auto-response option doesn't it?

You could use the search feature to see others that have faced your issue.


P.S. - What's with "Hello dears"? Makes me feel like my grandmother is posting in here. (creepy)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post

Link to post
Share on other sites

It is not built in, but msn has a plugin called "messenger live plus". Google it to find link.

This has a built in auto responder, and allows for user made scripts (like nudges tool script) that are written in javascript

I use it. I like it.


Share this post

Link to post
Share on other sites

Here ya go..! :)

Source :

#Include <String.Au3>
#Include <Date.Au3>
Opt ('WinTitleMatchMode','2')

$Msg = "Sorry, {Name}, I'm afk right now I will be back later."
$Log = @ScriptDir & '\Log.log'

While '1'
$Get = _GetMsnWindow ()
If $Get <> '-1' Then 
$Msg = StringReplace ($Msg, '{Name}', $Get['3'])
WinActivate ($Get['1'])
$Control = ControlGetFocus ($Get['1'])
$Before = ClipGet () 
ClipPut ($Msg)
ControlSend ($Get['1'], '', $Control, '{CtrlDown}{V}')
ControlSend ($Get['1'], '', $Control, '{Enter}')
ControlSend ($Get['1'], '', $Control, '{CtrlUp}')
_Log ('You got a message from ' & $Get['2'] & ':' & $Get['3'] & '.')
ClipPut ($Before)
WinClose ($Get['1'])
Sleep ('150')

Func _GetMsnWindow ()
Local $Title, $Email, $Return
$Title = WinGetTitle ('@')
If StringInStr ($Title, '<') <> '0' And StringInStr ($Title, '>') <> '0' Then 
$Email = _StringReverse ($Title)
$Email = StringSplit ($Email, '<')
$Email = _StringReverse (StringReplace ($Email['1'], '>',''))
$Name = StringReplace ($Title, ' <' & $Email & '>','')
Dim $Return['4']
$Return['1'] = WinGetHandle ($Title)
$Return['2'] = $Email
$Return['3'] = $Name
Return $Return
Return '-1'

Func _Log ($iText)
FileWriteLine ($Log, '[' & _NowTime () & '] ' & $iText)

This will scan for a window with a "@" in the title if it finds one it will then check to see if it has a "<" and a ">" if it masses theses tests it marks it as a msn window... it then will return the handle of the window, the email on the contact, and the name of the contact.

This only works on the new msn where it says name <email>;

Notes :

$Msg is the reply *{Name} will be replaced with the contacts name :party:!

Also it will logs any "messages" it gets (Needed because it has to close the msg window) *$Log is the file at witch it is logged to

Sorry I can't give you more details but I'm in a hurry!

Hope it helps! :idea: ~Enjoy~

- John

Latest Projects :- New & Improved TCP Chat

Share this post

Link to post
Share on other sites

Ty guys.

I've tried to search it but I didn't find much information myself. I have searched and found many things, but not like this.

Most I thank John2006 for his source and his explanation.

I already have an autoresponder, but I really wanted to find out how to do it myself, to improve my scripting skills.

thx again John2006. :)

Edited by bilarasgr

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this