Reading the most recent Event from Event Queue

BlitzMax Forums/BlitzMax Programming/Reading the most recent Event from Event Queue

tonyg: Your idea about PostEvent with Update=True was a good idea. I didn't know it could be done, but unfortunately, I can't use it to stop the event triggering.

To give you a better idea, I have an event hook which detects if a window is being moved, rounds the windows position to the nearest 5 (like snap to grid) and moves the window to the rounded co-ordinates using the SetGadgetShape() command. However, using this command generates another EVENT_WINDOWMOVE, which is rounded, repositioned and relocated using SetGadgetShape(), which generates another EVENT_WINDOWMOVE etc. etc. Anyway, you end up with a window jumping all over the place as soon as it enters this cyclic mess.

So I need to stop the EVENT_WINDOWMOVE from firing when I call SetGadgetLayout() or kill the event, before the event handler get's its hands on it.