Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
2
Erster Beitrag:
vor 3 Wochen, 2 Tagen
Letzter Beitrag:
vor 3 Wochen, 1 Tag
Beteiligte Autoren:
Mujahid, Curtis

[WD22] How to display an animation when running a long process.

Startbeitrag von Curtis am 02.02.2018 23:31

If I have a query that takes some time I want to show a loading window with an animated image. In the past I've done it with gifs similar to how DW describes in the post below.

http://27130.foren.mysnip.de/read.php?27131,77929,77929#msg-77929

The problem is that this way causes the windows taskbar to display above our fullscreen app when the thread runs. Also, it causes random crashes from time to time. Probably because "A secondary thread cannot directly open a window with the standard WLanguage functions such as: Open, Use, ..." (Source) Using ExecuteMainThread() doesn't work either. The animation is still blocked by whatever WinDev code/query is running.

Antworten:

Hi Curtis,

I do like this and its work for some of function.

But when i apply to another process with the same code, it is not work (hang).

Maybe you can test it.

// BUTTON REPORT
IF WinStatus(WIN_Progress_PleaseWait)=NotFound THEN
OpenChild(WIN_Progress_PleaseWait)
WIN_REPORT.lp_ItemGroupSales1() // Local Procedure
ELSE
ToastDisplay("Report under process",toastLong,vaMiddle,haCenter,iLightRed)
END


HourGlass()

//lp_SalesByItemGroup1
ThreadExecute("Thread A",threadNormal,lp_SalesByItemGroup1)
ThreadWaitSignal()

HourGlass(False)


PROCEDURE lp_SalesByItemGroup1()

ThreadSendSignal(“.”)

// Your Query Process Here


// Next
nSubscript is int
sThreadName is string
nNbThreads is int
nNbThreads = gnThreadNum

// Stop all the existing threads
FOR nSubscript = 1 TO nNbThreads
sThreadName = csThreadNameA+nSubscript
// Check whether the thread exists
IF ThreadState(sThreadName)threadUnknown THEN
// Attempt to stop the thread
IF ThreadStop(sThreadName,200)=False THEN
// Check whether it still exists
IF ThreadState(sThreadName)threadUnknown THEN
Error(StringBuild("Unable to stop thread #: %1",nSubscript))
END
END
END
END

iConfigure(gS_PPReceipt_PrinterReport)
iWindowCancel(False)
iPreview(i100)
iPrintReport(RPT_SalesReportItemGroup)

Close(WIN_Progress_PleaseWait)


Regards,
Mujahid

von Mujahid - am 02.02.2018 23:54
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.