MsgWait with timer

MsgWait with timer

Postby José Luis Sánchez » Wed Feb 28, 2018 3:29 pm

Hello,

It's possible include a timer in MsgWait to show a count back to zero ?

A message like:
Wait 15 seconds to...
Wait 14 seconds to...

Done !

and then close the dialog ?

Regards,
José Luis
User avatar
José Luis Sánchez
 
Posts: 556
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España

Re: MsgWait with timer

Postby karinha » Wed Feb 28, 2018 4:12 pm

Hago asi:

Code: Select all  Expand view

      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
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: MsgWait with timer

Postby José Luis Sánchez » Thu Mar 01, 2018 3:07 pm

Thank you Joao !!
User avatar
José Luis Sánchez
 
Posts: 556
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests