FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour MsgWait con timer
Posts: 564
Joined: Thu Oct 13, 2005 09:23 AM
MsgWait con timer
Posted: Wed Feb 28, 2018 03:31 PM

Hola,

Es posible incluir un timer en MsgWait para que muestre una cuenta atrás a cero ?

Un mensaje así:
Espera 15 segundos para...
Espera 14 segundos para...

Hecho !

y entonces cerrar el diálogo ?

Saludos,
José Luis

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: MsgWait con timer
Posted: Wed Feb 28, 2018 04:11 PM
Hago asi:

Code (fw): Select all Collapse
      MsgRun( "Desligando o Programa...           ", ;
              "Por Favor, Espere!                 ", ;
              { | oDlg | ( DESLIGA_PROG( oDlg ) ) } )

   FreeResources()
   SysRefresh()
   DbCloseAll()
   RELEASE All
   Hb_GCAll( .T. )
   CLEAR MEMORY
   PostQuitMessage( 0 )
   __QUIT()

FUNCTION DESLIGA_PROG( oDlg )

   LOCAL nFor, nStart

   FOR nFor := 4 to 0 step -1
       nStart = GetTickCount()
       while ( GetTickCount() - nStart ) < 1000
       end
       oDlg:cMsg := "Aguarde, Desligando o Programa em: "+ ;
                     LTrim( Str( nFor ) ) + " Segundo"   + ;
                     If( nFor > 1, "s", "" )

       oDlg:Refresh()
       SysRefresh()

   NEXT

RETURN NIL


Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 564
Joined: Thu Oct 13, 2005 09:23 AM
Re: MsgWait con timer
Posted: Thu Mar 01, 2018 03:06 PM

Gracias Joao !!

Continue the discussion