PostMessage # How to pass Message back to Caller EXE??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • namhatre
    New Member
    • Nov 2007
    • 1

    PostMessage # How to pass Message back to Caller EXE??

    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
    Code:
    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..


    Code:
     PostMessage(HWND_BROADCAST, dbmesg, 0, 0);  strpcopy(mstr, 'WM_DBMESG');  dbmesg:=RegisterWindowMessage (mstr);

    I am not able to found any declaration for
    Code:
    HWND_BROADCAST

    Niks
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Is there any specific data you need to track in your postback message?
    Because the parent .EXE can tell when the child .EXE has exited (and can even get the exit status code I believe).
    So if all you need to know is when your child .exe exited, just use the Process.Exited( ) event to know when it's finished?

    Comment

    Working...