Solved

How to send message to another program(Written by C)?

Posted on 2002-06-27
1
175 Views
Last Modified: 2010-04-04
Hi all,
How to send message to another program(Written by C)?
I just need to send some simple message/data to another program. My program written by Delphi, the target program written by C.

Please tell me the detail.

Thanks, bin
0
Comment
Question by:xbbin
1 Comment
 
LVL 1

Accepted Solution

by:
h_mohsenian earned 50 total points
ID: 7114214
hi,

you can use PostMessage function. in the VC++ program you can choose a CWnd ( for example a CDialog ) and get its HWnd . after that use this code :

postMessage(VCProgramHandle : HWND , WM_TestMessage : cardinal , wParam , lParam );

also you can use FindWindow API function for finding your VC++ program Window Handle ( the HWND ) in your Delphi program directly.

for example :

Hwnd := FindWindow('CWnd','MyMainVCPPDialogName');

postmessage(Hwnd,...);

I hope it can help you.
Hamed
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now