message passing between threads in c#
Hi all,
I have a c# application. I got there a Gui thread, that runs a status bar panel, (like MSN messenger), and waits for the user to open any window. I got also another thread that sometimes opens a popup. I got a button on the popup, and when the user clicks there, i want to open some window.
If i listen to the event and open the window, the popup stucks there, till i close the window (cause it runs in the popup thread and not in the GUI thread). I want to open the window in the GUI thread.
How should i do that? Is there a way to excute some function in other thread? or pass a message to the other thread?
by the way, the GUI thread is a regular thread (i made and ran it) so there's no "beginInvoke" method, i just got an instance to the thread.
Thanks alot,
Hisham
|