Shmuel,
Yes. But, the thread must be implemented specifically for that type of
behavior. To create your own thread that does this you need to have it
run an infinite loop that waits for an object to appear in a queue.
When an object appears the thread wakes up and processes that object
accordingly. Other threads have access to the queue so that they can
enqueue objects at any time.
UI threads behave this way because they run a windows message pump.
Other threads can instruct the UI thread to run some function by using
Control.Invoke. Invoke takes a delegate as a parameter and posts a
message to the UI thread's message queue instructing it to execute the
specified delegate.
Brian
S Shulman wrote:
Hi
Is there any method to send a message to a running thread so the
thread will perform a specific function before the program
suspends it?
Thank you,
Shmuel Shulman