Delphi and Kylix

Moderators: pritaeas
Number of threads: 7244
Number of posts: 19051

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to receive Messages from other application Posted by dubi on 15 Jul 2005 at 12:45 AM
Suppose if I send a message from one application,
how can the other application receive the message that I send.
I can use SendMessage API to send a message.
What should I use to receive a Message.

From Application1,I use

const WM_MYMESSAGE WM_APP+$200
SendMessage(appHandle,WM_MYMESSAGE,0,0);

What should be written in Application2 to receive this message.

Thanks for your replies.
Report
Re: How to receive Messages from other application Posted by zibadian on 15 Jul 2005 at 12:57 AM
: Suppose if I send a message from one application,
: how can the other application receive the message that I send.
: I can use SendMessage API to send a message.
: What should I use to receive a Message.
:
: From Application1,I use
:
: const WM_MYMESSAGE WM_APP+$200
: SendMessage(appHandle,WM_MYMESSAGE,0,0);
:
: What should be written in Application2 to receive this message.
:
: Thanks for your replies.
:
You need to write an OnMessage() event for the application.
Report
Re: How to receive Messages from other application Posted by dubi on 15 Jul 2005 at 1:13 AM
: : Suppose if I send a message from one application,
: : how can the other application receive the message that I send.
: : I can use SendMessage API to send a message.
: : What should I use to receive a Message.
: :
: : From Application1,I use
: :
: : const WM_MYMESSAGE WM_APP+$200
: : SendMessage(appHandle,WM_MYMESSAGE,0,0);
: :
: : What should be written in Application2 to receive this message.
: :
: : Thanks for your replies.
: :
: You need to write an OnMessage() event for the application.
:

Can you kindly give a sample piece of code,what to write
in OnMessage() event.I haven't used Message Handling.
Thanks Zibadian.

Report
Re: How to receive Messages from other application Posted by zibadian on 15 Jul 2005 at 4:48 AM
: : : Suppose if I send a message from one application,
: : : how can the other application receive the message that I send.
: : : I can use SendMessage API to send a message.
: : : What should I use to receive a Message.
: : :
: : : From Application1,I use
: : :
: : : const WM_MYMESSAGE WM_APP+$200
: : : SendMessage(appHandle,WM_MYMESSAGE,0,0);
: : :
: : : What should be written in Application2 to receive this message.
: : :
: : : Thanks for your replies.
: : :
: : You need to write an OnMessage() event for the application.
: :
:
: Can you kindly give a sample piece of code,what to write
: in OnMessage() event.I haven't used Message Handling.
: Thanks Zibadian.
:
:
procedure TForm1.OnMessage(var Msg: TMsg; var Handled: Boolean);
begin
  if Msg.Message = WM_MYMESSAGE then
  begin
    DoSomething(Msg.wParam, Msg.lParam);
    Handled := true;
  end;
end;




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.