I have a window that indicates a long process is in progress. Sadly, after a while, if the process takes too long, Windows appends “Not Responding” onto the window’s title text in red and turns the close box red.
For this process it’s totally normal, but I’d prefer that the user doesn’t get all panicked about that, so I’d like to HIDE the title bar, if possible. (or inhibit the “not responding” message, which I guess is even more unlikely?
I suspect I have to CREATE the window with no title bar right from the start?
You should move your long operating code in to a thread so that your UI doesn’t become unresponsive in the first place. Hiding the fact that your event loop is being held up isn’t the solution to your issue.
What you suggest would be the ultimate solution, but this is code that is calling out to a DLL, which in turn is communicating with a server. When the same DLL code is called on MacOS it’s not a problem. But it shows up on Windows / Xojo.
So for right now, I just don’t want the user getting concerned. I can see that Xojo itself can have this issue with its own windows (like during a long build), and Windows programs (like RegEdit, for example), will sometimes show “Not Responding” while a long search is in progress.
The thread is the only way to go, if you want to solve the nasty message for good.
You get the not responding message because the main thread that services the Windows event loop has blocked for too long.
Quite often the solution is to put your long running code into a Xojo thread.
Unfortunately, Xojo threads only use a single CPU core so if a single call (such as a call to your DLL) takes a long time, you will still suffer from the problem.
- Try moving the code to a thread.
- See if the DLL supports some kind of async mode.
- Use the Xojo worker feature to run the DLL in a separate process,
- Create a Xojo C/C++ plugins that runs the DLL in a preemptive thread.
- Don’t use Xojo.