• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1625
  • Last Modified:

Messenger API and Delphi

Hi Experts,

I did the import of Messenger API type Library and I would like to know if there is any way to send and receive messages to a contact through this api, if yes, please some source code.

I am using delphi 7

Thx
0
alpires
Asked:
alpires
  • 2
1 Solution
 
BigRatCommented:
The old MAPI interface????

Sending Mail for example : http://www.delphifaq.com/faq/delphi/network/f236.shtml

Or the Exchange interface?

http://www.imibo.com/imidev/delphi/les/index.html

0
 
BigRatCommented:
You can also pick up a lot of course code at torry.ru under Components/Communication/Mapi
0
 
alpiresAuthor Commented:
Bigrat, "Messenger API type Library" is api Windows Messenger
0
 
CodedKCommented:
Hi Alpires.

+ Some nice component : http://www.imcomponents.com/ivc.htm
+ SourceForge Project : http://sourceforge.net/projects/activemsn/

+ Some code...
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
var
Msg:IMessenger3;
....

Procedure Form1.OnCreate...
  Msg:=MessengerAPI_TLB.CoMessenger.Create;
....

Procedure MsgContact(Message_Str:String; Email:String);
var
Contacts:IMessengerContactsDisp;
Contact:IMessengerContactDisp;
MsgWND:IMessengerConversationWndDisp;
ww:HWND;
i,n,q:Integer;
begin
  Contacts:=IMessengerContactsDisp(Msg.MyContacts);
  i:=Contacts.Count;
  n:=0;
  while n < i do
  begin
  Contact:=IMessengerContactDisp(Contacts.Item(n));
  if Contact.SigninName = Email then
  begin
  MsgWnd:=IMessengerConversationWndDisp(Msg.InstantMessage(Msg.GetContact(Contact.SigninName,Contact.ServiceId)));
  ww:=FindWindowEx(msgwnd.HWND,0,'DirectUIHWND',nil);
  for q:=0 to Length(s) do SendMessage(ww, WM_CHAR ,Word(Message_Str[q]),0);
  PostMessage(ww, WM_KEYDOWN, VK_RETURN, 0);
  PostMessage(ww, WM_KEYUP, VK_RETURN, 0);
 
  //Optional ---------------------
  MsgWnd.Close;  {Close Window After Sending Message}
  //-------------------------------
  end;
  inc(n)
  end;
end;
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Author : Kuroi Saru


Hope this helps.
CodedK
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now