In this topic:
viewtopic.php?f=3&t=10439
I read is not possible use mult-thread in FWH, but you ask for what
need this...
Please, see the code below:
Code: Select all | Expand
//------------------------------------------------------------------------------Function Test()MsgProgres('Executing SQL query...','Wait, please...',{|| Query() },.F.)SELECT TEMPGO TOPBROWSE()return//------------------------------------------------------------------------------//------------------------------------------------------------------------------FUNCTION Query()cSqlComand = "SELECT ID,Name,City,Country,Phone FROM tbCustomers ORDER BY Name"USE 'tbCustomers' AS cSqlComand ALIAS 'TEMP' VIA 'MySQL'RETURN//---------------------------------------------------------------------------------//---------------------------------------------------------------------------------FUNCTION MsgProgres(cCaption,cTitle,bAction)LOCAL oDlgLOCAL nWidth:=0PRIVATE nContx:=0, oTimerx, oProgressDEFINE DIALOG oDLG FROM 01,01 TO 09,41 TITLE cTitle STYLE DS_MODALFRAMEoProgress = TProgress():New(02,01,oDlg,0,,,.F.,.F.,140,10)nWidth=oDLG:nRight-oDLG:nLeftoDlg:bStart = {|| Eval(bAction,oDlg),; oTimerx:End() ,; oDlg:End() ,; SysRefresh() }oDlg:bPainted = {|hdc| oDlg:Say(01,02,xPadr(cCaption,nWidth)), SysRefresh() }ACTIVATE DIALOG oDlg CENTER ON INIT (xInic(oDlg),oTimerx:Activate(),SysRefresh()) RETURN //---------------------------------------------------------------------------------//---------------------------------------------------------------------------------FUNCTION xInic(oDlg)DEFINE TIMER oTimerx OF oDlg INTERVAL 1 ACTION (oProgress:SetPos(++nContx),; nContx:=IF(nContx>150,0,nContx),; SysRefresh())RETURN//---------------------------------------------------------------------------------
I need start another thread because a SQL query make a current thread busy
and the timer of the progress bar dont work...
In this case, I will call a timer from second thread...
Any sugestion ?
regards