SendMessage to Worker thread
-
Is it possible to send a message to a worker thread? I know we could send a message to a UI thread, but is the same possible with a worker thread? Thanks, AJ
-
Is it possible to send a message to a worker thread? I know we could send a message to a UI thread, but is the same possible with a worker thread? Thanks, AJ
I assume by the term "a message" you mean a message such as sent by the functions
SendMessage
,PostMessage
,PostThreadMessage
and friends. If so the answer is yes but there is a catch: the receiving thread must be running a message pump and in the case of thread messages it will have to be written accordingly.Steve
-
Is it possible to send a message to a worker thread? I know we could send a message to a UI thread, but is the same possible with a worker thread? Thanks, AJ
-
Worker threads dont have MessagePump. So I dont think SendMessage,PostMessage or Post ThreadMessage will work. to send messages to worker threads you can try and use events.
-
Is it possible to send a message to a worker thread? I know we could send a message to a UI thread, but is the same possible with a worker thread? Thanks, AJ
Ajay L D wrote:
I know we could send a message to a UI thread, but is the same possible with a worker thread?
you have to setup message pump in the thread to handle message
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
-
kvrnkiran wrote:
Yes. It is possible. Use PostThreadMessage. Hope that helps.
hi kiran, you have to setup message pump in the worker thread to process message send thorugh PostThreadMessage!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You