Is that normal?
call SalYieldStartMessages( hWndFrame ).
Code: Select all
On SAM_Click Call SalMessageBox( 'Click', 'Info', MB_Ok ) Call SalYieldStartMessages( hWndForm ) While 1 Set nCount = 0 While nCount < 10000 Set nCount = nCount + 1 Set nDisplay = nDisplay + 1 Call SalStatusSetText( hWndForm, SalNumberToStrX( nDisplay, 0 ) )
[ frevel & fey ] Software-System GmbH
- Founder/Site Admin
- Posts: 691
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
It is a Windows feature that when an application GUI thread does not respond within 5 seconds, Windows will "ghost" the window and freeze the contents.
The title bar will also show "not responding".
This feature enables the user to move the frozen window, but the contents are not updated.
Read this article for more info :
https://blogs.technet.microsoft.com/ask ... r-windows/
To disable this feature, use the WinApi function from user32.dll :
But be aware that when disabled, the window can not be used (moved, closed) until the GUI has finished the long action.
The issue with TD applications is that they do not have a separate GUI thread.
So when your application performs a lengthy operation (database update, calculations etc) which takes longer than 5 seconds, your application will be ghosted by Windows.
It would be nice Gupta finds a way to prevent this ghosting out-of-the-box.
(Maybe using the TD 7.1 multi-threading feature?)
You can download a sample to show how to call
http://samples.tdcommunity.net/index.ph ... Sample.zip
How to use:
- Run sample as executable
- Press button to start lengthy operation for 30 seconds. During execution the datafield is updated with the current time
- Switch to another application and wait 5 seconds as minimum
- Go back to the sample and see that the window is frozen
- When 30 seconds are over, the form is unfreezed and can be used again
Now repeat this but first check the option to disable ghosting.
See that now, the datafield is updated during the 30 seconds and no "not responding" text is displayed in the title bar.
This sample also shows the "Yielding" solution by using a hidden form which is yielded.
Who is online
Users browsing this forum: [Ccbot] and 0 guests