I want to pop up a window to show that a program is busy with a particular time consuming task. But I don’t want any buttons on it. I just want to pop it up, do the task, then remove it. I’m not sure what such a window is called and so don’t know what to search for in MSDN etc. Is there some ready made API for this kind of thing or do I need to cook my own?
EDIT: In answer to some comments…
I’m not using MFC.
The program is for my own use – the answer does not have to look pretty.
The reason I don’t just rely on the hourglass is that the hourglass only shows when the cursor is on top of the applications small window, and I work on a system with four very large monitors and the cursor is often not on the window in question.. If I don’t see an hourglass then my program looks like its crashed. Its quite disturbing. I work on this program continuously as my job, and have done so for many years. The operation that takes a long time is performed only occasionally, I may go months without using it. So if it locks up doing this task I’m worried that I will have forgotten that its just busy and assume there’s some bug and go on a wild goose chase trying to fix a problem that does not exist.
This is actually a more profound question than simply dialogs. If you are engaging in work which may take a long time, then you don’t want it on the main thread. On Windows versions prior to Vista, the Window won’t paint – you end up with “white window” syndrome, which is very ugly. Far better to create a worker (non-ui) thread and have it post a message back to the main window when it’s done. Obviously you have to have some sort of timeout in case it never finishes. If you do it this way, then the “dialog” problem becomes an issue of simply putting up a window and pulling it down again when the thread sends you its “done” message. You can try looking at the MSDN documentation for “modeless dialog”, a dialog which can you can create and destroy at will (remember to disable the main window). There are some nits with implementing this in MFC, but you don’t say whether you’re using that or not.