[Lazarus] Message Loop paused when no interaction with mouse?
prof7bit at googlemail.com
Thu Apr 21 16:56:29 CEST 2011
On Apr 20, 2011 7:52pm, Bernd <prof7bit at googlemail.com> wrote:
> I have tried QueueAsyncCall and Synchronize() both don't work here.
> PostMessage() works.
I have now done the following to "simulate" a Synchronize()
with the help of PostMessage()
This seems to work without problems, without crashing, without noticeable
strange behavior and is running smoothly. Is the following usage of
RTLeventWaitFor correct or am I abusing/missing something and
calling for trouble?
in my worker thread I have:
GuiHasFinishedEvent := RTLEventCreate;
// wite to the image
// Image.Picture.Bitmap.RawImage.Data[somewhere] := something;
// frame is complete, notify GUI
PostMessage(Application.MainForm.Handle, MM_FRAME_COMPLETE, 0, 0);
and in my Form:
TMainForm = class(TForm)
procedure OnCameraFrame(var Msg); message MM_FRAME_COMPLETE;
procedure TMainForm.OnCameraFrame(var Msg);
// it is alaways in updatig state, only release this for a short moment
// the camera thread is waiting, notify it that we are done.
More information about the Lazarus