messages
-
I have a DLL, this export some functions and one of them starts a new thread. from this thread my Program recieve some userdefined messages. in C++ everything ist OK, but I have to supply the functionality of this DLL for a C# App. And I don't know how to catch the messages from the thread.... If I look with Spy++ to the Form, it recive them, but I have no idea how to handle them....
-
I have a DLL, this export some functions and one of them starts a new thread. from this thread my Program recieve some userdefined messages. in C++ everything ist OK, but I have to supply the functionality of this DLL for a C# App. And I don't know how to catch the messages from the thread.... If I look with Spy++ to the Form, it recive them, but I have no idea how to handle them....
To get the messages you can override the WndProc method on your Control/UserControl/Form.
protected override void WndProc( ref Message m ) {
switch(m.Msg) {
case MY_CUSTOM_MSG:
// do stuff with the msg
// LPARAM = m.LParam
// WPARAM = m.WParam
// Place any result value in m.Result
break;
default:
base.WndProc(m);
break;
}
}That should be the basic look of it. HTH, James Sonork ID: 100.11138 - Hasaki "Smile your little smile, take some tea with me awhile. And every day we'll turn another page. Behind our glass we'll sit and look at our ever-open book, One brown mouse sitting in a cage." "One Brown Mouse" from Heavy Horses, Jethro Tull 1978
-
To get the messages you can override the WndProc method on your Control/UserControl/Form.
protected override void WndProc( ref Message m ) {
switch(m.Msg) {
case MY_CUSTOM_MSG:
// do stuff with the msg
// LPARAM = m.LParam
// WPARAM = m.WParam
// Place any result value in m.Result
break;
default:
base.WndProc(m);
break;
}
}That should be the basic look of it. HTH, James Sonork ID: 100.11138 - Hasaki "Smile your little smile, take some tea with me awhile. And every day we'll turn another page. Behind our glass we'll sit and look at our ever-open book, One brown mouse sitting in a cage." "One Brown Mouse" from Heavy Horses, Jethro Tull 1978