Emptying message queue without processing lazarus / 31-LCL ---------------------------------------------------------------------- simone · 2018-03-08 22:34 Dear all, is it possible to empty the message queue in a GUI application without processing the waiting messages? Thanks in advance. ---------------------------------------------------------------------- ASerge · 2018-03-08 23:26 Quote from: simone on March 08, 2018, 11:34:40 pmDear all, is it possible to empty the message queue in a GUI application without processing the waiting messages? Thanks in advance. In Windows, the Application.ProcessMessages procedure first calls MsgWaitForMultipleObjects with Timeout = 0, and if there are messages, it performs a message queue clearing cycle: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i       while PeekMessage(AMessage, HWnd(nil), 0, 0, PM_REMOVE) do      begin      if AMessage.message = WM_QUIT then        begin          PostQuitMessage(AMessage.wParam);          break;        end;        TranslateMessage(@AMessage);        DispatchMessageW(@AMessage);      end;