C
Claire
(Relative newby)
Ive a secondary thread reading files from a serial port.
Ive also got a form with a progress bar informing the user on the status of
downloading the file. The progress delegate is called from the context of
the thread.
The form works fine if it's the topmost window but if it ever becomes
obscured by another application then it never gets invalidated/repainted
properly when it's redisplayed (even with lots of Thread.Sleep(0)s ).
So I thought I'd try to fix this by posting a user defined message from the
delegate to the form so that the progress message was handled in the context
of the application. (Im from a delphi background and we had to use
synchronize method of tthread when we wanted to update forms from worker
threads)
So, now I've found a Message struct and that I can overload the wndproc
function but I can't seem to find any info on the eqivalent of the
PostMessage function. Can someone help please.
Ive a secondary thread reading files from a serial port.
Ive also got a form with a progress bar informing the user on the status of
downloading the file. The progress delegate is called from the context of
the thread.
The form works fine if it's the topmost window but if it ever becomes
obscured by another application then it never gets invalidated/repainted
properly when it's redisplayed (even with lots of Thread.Sleep(0)s ).
So I thought I'd try to fix this by posting a user defined message from the
delegate to the form so that the progress message was handled in the context
of the application. (Im from a delphi background and we had to use
synchronize method of tthread when we wanted to update forms from worker
threads)
So, now I've found a Message struct and that I can overload the wndproc
function but I can't seem to find any info on the eqivalent of the
PostMessage function. Can someone help please.