Hello,
I am new to .net n working with Framework 3.5
Currently working on Application developed in Borland Delphi.
We have 2 exe's named as DBPro.exe and Data.exe
I am rewriting Data.exe which deal with Data Interaction with SQL Server.
Now the project work like, We have button in DBPro.exe which Opens up Data.exe n while doing this it Passes the Message to it using Post Message. I dont have code for DBPro.exe
After All work wen we close Data.Exe it is suppose to PostBack message to Calling Exe i.e. DBPro.exe which will reinitialize it.
I found line PostMessage(HWND_BROADCAST, dbmesg, 0, 0); in Data.exe, in the Form End section which is suppose to Post Back the Message. Now I want to do the same with my new Data.exe. So far I found I can use some invoke method but have no idea how to use it.
I'll appriciate any pointers on this issue.
Thanks.
Some declarations look like this..

PostMessage(HWND_BROADCAST, dbmesg, 0, 0);
strpcopy(mstr, 'WM_DBMESG');
dbmesg:=RegisterWindowMessage (mstr);
I am not able to found any declaration for HWND_BROADCAST

Nik Mhatre3 reputationPosted Jul 16, 2008, 9:18 AM EDT
private void btnClose_Click(object sender, EventArgs e) { const int dbmesg=49706; const int HWND_BROADCAST=65535; Win32.PostMessage(HWND_BROADCAST,dbmesg, 0, 0); this.Close(); } public class Win32 { [DllImport("user32", EntryPoint = "PostMessage")] public static extern int PostMessage(int hwnd, int wMsg, int wParam, int lParam); }This will Close the Data.Exe and Broadcast Message. I Defined the same constant I found in Old code, even when I dont really know what they really mean.. But this code is working for me.. To Import Win32.dll need to add using System.Runtime.InteropServices; namespace!! Guys.. any one know how exactly this work.. to give more understanding..!! Thanks