
Sending messages form one to another app ?? WM_COPYDATA how ?
I think I did this a couple of years ago and I think it worked something
like this.
Define a new window class for the main windows of the two app.
i.e WNDCLASS class1;
class1.lpszClassName="App1MainWindow"
RegisterClass(&class1);
WNDCLASS class2;
class2.lpszClassName="App2MainWindow"
RegisterClass(&class2);
If each app knows the class name of the other apps main Window you can use
FindWindow to get the window handle of the other apps main Window and then
PostMessages to it.
e.g in App1
CWnd *pWndApp2=CWnd::FindWindow("App2MainWindow",NULL);
if(pWnd != NULL)
{
pWnd->SendMessage(.......
Quote:
}
similar in App2
There is a technical note which describes how to change the Window class for
MFC apps.
(TN001: Window Class Registration).
We used to store the actual class names in an ini file so that the apps can
read each others class names at run time.
This method worked ok in Windows 3.1 I've not tried it on 95/NT.
Hope this helps.
Quote:
>I have 2 MFC applikations and I would like to tell the one applikation what
>to do from the other.
>I have found out that it is possible to send data from one applikation to
>another with the WM_COPYDATA message, but how do I send and recive this
>message ??
>I Guess that I have to use SendMessage, but how is this done in MFC ?
>IN SDK I have to use the the recive HWND and the sending HWND, but how do
>get these handles in MFC?
>I hope that some one can help me with this !
>Thomas