?
Solved

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

Posted on 2002-06-27
1
Medium Priority
?
200 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 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

839 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