Hi Pierre,
1. We tested in PB 12.5, 12.6 and 2017 and could also get the ‘Not Responding’ message in the title bars. The results are the same as John’s.
2. And Stuart’s explanation is correct, this is Windows functionality. I confirm that you can use the Windows API to call DisableProcessWindowsGhosting() to work it around.
You can declare like this: SUBROUTINE DisableProcessWindowsGhosting() library "User32.dll"
3. When Windows asks a program to do something, like take a keystroke or close itself, and the program fails to acknowledge that request within a certain amount of time, the program is “Not Responding”. If the program never comes out of that state, we might also call it “hung”, as in “hung up” on something.
There are “legitimate” reasons this can happen. For example, if the program you’re using is doing some very long, CPU-intensive calculation, it might not respond in a timely fashion. An example might be a graphics program performing a reduction or other operation on a large image. If, during that operation, you attempt to close the window and nothing happens, after a few seconds Windows might add “(Not Responding)” to the title bar to indicate that it has tried to pass your request to the application, but the app’s not listening.
Anything that causes the application to stop responding can cause Windows to add the ‘(Not Responding)’ moniker to the title bar.
While it might be considered bad form or bad design to not respond to user input or to Windows while performing lengthy calculations, it’s quite legal and legitimate. Once the calculation is complete, the program starts listening and responding again.
You can also refer to the following links for details.
https://askleo.com/not_responding_what_does_it_mean_and_what_do_i_do_about_it/
https://social.msdn.microsoft.com/Forums/vstudio/en-US/d231c26f-a74f-4f91-9fce-43ec23691b64/title-bar-says-not-responding-but-program-still-working-on-long-process?forum=vcgeneral
Regards,
Mark Lee
Thank you for useful links and explanations. I just tested DisableProcessWindowsGhosting(), it works and with it I obtain the same behavior as PB12.5. I'm surprise that you can't reproduce my test. Did you see my small video comparison between 12.5 and 2017?
I suppose there is something in 12.5 that do the DisableProcessWindowsGhosting() job.
So we have 2 solutions, either enhance our code to add nice waiting progress bar or plug the DisableProcessWindowsGhosting(). Thank you for your help.
Regards.
FWIW: The other alternative where your PB App knows that its going to invoke a long running process is to perform that action in another thread. This would be accomplished by using PB's multi-threading feature, where the min thread delegates long running tasks to a sub-thread. Thus the main thread (your App) still keeps responding to the App user.
FYI: http://chrispollach.blogspot.com/2019/10/std-integrated-framework-multi.html
Food for thought
Regards ... Chris