program ptestmsgretardados;
uses
  cthreads, cmem, sysutils, uemuladorwinipc, usemaforopolenta, ipcobjs, ukeydir,
  uwinmsgs, unettopos, unettopostypes, uglobsharedmem, uHeapManager,
  uconstantes_nettopos, Classes, winLinuxUtils, uConstantesSimSEE,
  uMsgRetardados, uTestMsgRetardados, uFuncionesAuxiliares;

procedure TFmth_execute;
var
	m: TWinMsg;
begin
  writeln('TFmth_execute->Form1.Create');
  Form1 := TForm1.Create(NIL);
  writeln('TFmth_execute<-Form1.Create');

  getOLanzarTopoLocal;


  while Form1.recolectar do
  begin
   writeln(' esperando msg ');
   if xGetMessage_WAIT( m ) = 0 then
   begin
     writeln('Form1 mensaje: ', m.msgCode,' : ',m.wParam,' : ',m.lParam);
     if m.msgCode <> WM_CLOSE then
       Form1.Dispatch(m)
     else
     begin
       writeln('Saliendo por recibir WM_CLOSE.');
       Form1.recolectar:= false;
     end;
   end
   else
     write('-');
  end;
writeln('TFmth_execute->Form1.Free');
  Form1.Free;
writeln('TFmth_execute->fin.');
end;

begin

  CrearArchivosKeys;
  TFmth_execute;

end.
