
Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
Hi!
> Have you taken a look at the Invoke method on the Control class? It
> will do what you want, you pass it a delegate and arguments to be passed
> to the delegate, and it will make the call to the delegate on the thread
> that created the control.
The help file says:
"If the control's handle does not exist yet, this method searches up the
control's parent chain
If no appropriate handle can be found, the Invoke method will throw an
exception."
My component does not have a parent. In C++ I would call:
CreateWindowEx(WS_EX_TOOLWINDOW,...
To get the handle.
Thanks!
Atmapuri
Nicholas Paldino [.NET/C# MVP] - 17 Oct 2007 15:56 GMT
Atmapuri,
Well, if that component is expecting windows messages, then it means
that it is pumping for them on a particular thread. If you have a thread
id, then you can send a message to that thread queue calliong the
PostThreadMessage API function through P/Invoke. If you have a handle to a
window that is owned by that thread, then you can call SendMessage through
the P/Invoke layer.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> Hi!
>
[quoted text clipped - 17 lines]
> Thanks!
> Atmapuri