J
Jochen Hahnen
Hello!
I need to catch some WM_COPYDATA messages sent by an external unmanaged
application. After reading a lot of documentation I tried the following
solution using the MessageWindow class:
public class ReceiveTomTomEvents : MessageWindow
{
const int WM_COPYDATA = 0x004A;
public ReceiveTomTomEvents()
{
}
protected override void WndProc(ref Message msg)
{
switch(msg.Msg)
{
case WM_COPYDATA:
//Do something here
break;
default:
//Do something else
break;
}
// call the base class WndProc for default message handling
base.WndProc(ref msg);
}
}
in my main class I have the following line to instanziate the MessageWindow:
tomtomEvents = new ReceiveTomTomEvents();
My problem is that the case WM_COPYDATA is never riched during debugging
although the documentation of the used dll definitely states that this
type of message is sent ("After the request has been created, a
notification is sent to the external application, in the form of a
Windows WM_COPYDATA message to the main window of the external
application") and I am realy sure that there is such a message!
Instead of this type of messages I receive a lot of messages with code
13(in the default case)!
Is there anything wrong in this code?
By the way the "external application" needs a textfile with some
input-data and there is a field where I have to enter the application
main title. What exactly is meant with application main title? For
example is "Form1" the application main title if the name of my main
window is "Form1"?
Thanks in advance for your efforts!
Jochen
I need to catch some WM_COPYDATA messages sent by an external unmanaged
application. After reading a lot of documentation I tried the following
solution using the MessageWindow class:
public class ReceiveTomTomEvents : MessageWindow
{
const int WM_COPYDATA = 0x004A;
public ReceiveTomTomEvents()
{
}
protected override void WndProc(ref Message msg)
{
switch(msg.Msg)
{
case WM_COPYDATA:
//Do something here
break;
default:
//Do something else
break;
}
// call the base class WndProc for default message handling
base.WndProc(ref msg);
}
}
in my main class I have the following line to instanziate the MessageWindow:
tomtomEvents = new ReceiveTomTomEvents();
My problem is that the case WM_COPYDATA is never riched during debugging
although the documentation of the used dll definitely states that this
type of message is sent ("After the request has been created, a
notification is sent to the external application, in the form of a
Windows WM_COPYDATA message to the main window of the external
application") and I am realy sure that there is such a message!
Instead of this type of messages I receive a lot of messages with code
13(in the default case)!
Is there anything wrong in this code?
By the way the "external application" needs a textfile with some
input-data and there is a field where I have to enter the application
main title. What exactly is meant with application main title? For
example is "Form1" the application main title if the name of my main
window is "Form1"?
Thanks in advance for your efforts!
Jochen