Board index » delphi » !! How to send a message to an object and getting the answer back

!! How to send a message to an object and getting the answer back

I have the following problem, I want to send a message to the
application wich then sends the message to the active mainwindow. Then
this mainwindow must send back a string.  The main window knows wich
alias is active. then i create a form wich has to know wich alias the
main form is using. so i can open a file in this alias.

I thought it was possible to send a message from my object, for example
SendMessage(Application.Handle,LM_GetActiveAlias,?,?) ;
But then I don't know where to put the answer.

Please send an answer to my mailbox sa...@worldaccess.nl

 

Re:!! How to send a message to an object and getting the answer back


If the forms are in the same application, you don't need to. For example,
if you have a TTable on a form called frmMain, you can access it from
another form (call it frmAnother) by using

frmMain.TheTable.DatabaseName

You also need to include the unit that contains frmMain in the uses clause
of the unit that contains frmAnother.

If I have totally missed the point, and you just need to know how to
reference the active form, just use Screen.ActiveForm.

--

Mark P
-----------
http://www.ozemail.com.au/~pritchma

Andre Mens <sa...@worldaccess.nl> wrote in article
<32C68886.3...@worldaccess.nl>...

Quote
> I have the following problem, I want to send a message to the
> application wich then sends the message to the active mainwindow. Then
> this mainwindow must send back a string.  The main window knows wich
> alias is active. then i create a form wich has to know wich alias the
> main form is using. so i can open a file in this alias.

> I thought it was possible to send a message from my object, for example
> SendMessage(Application.Handle,LM_GetActiveAlias,?,?) ;
> But then I don't know where to put the answer.

> Please send an answer to my mailbox sa...@worldaccess.nl

Other Threads