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:
1 function DisableTaskWindows(ActiveWindow: HWnd): Pointer;
2 procedure EnableTaskWindows(WindowList: Pointer);
Both are exported by the forms unit but are not documented. You use them like this:
3 var4 p: Pointer;
5 6 waitform.show;
7 application.processmessages; {needed to get form to paint}8 p := DisableTaskWindows(waitform.handle);
9 try10 { ... do stuff here }11 finally12 EnableTaskWindows(p);
13 waitform.close;
14 end;