Author: Jonas Bilinkevicius
I would like to create a form in my program that is a please wait type of form. I
need the form to have the same behaviour as a modal form, but not to stop the
execution of the program.
Answer:
So use Show to show the dialog and disable all other forms in your application
using the same function a modal dialog uses:
function DisableTaskWindows(ActiveWindow: HWnd): Pointer;
procedure EnableTaskWindows(WindowList: Pointer);
Both are exported by the forms unit but are not documented. You use them like this:
1 var2 p: Pointer;
3 4 waitform.show;
5 application.processmessages; {needed to get form to paint}6 p := DisableTaskWindows(waitform.handle);
7 try8 { ... do stuff here }9 finally10 EnableTaskWindows(p);
11 waitform.close;
12 end;