Author: Jonas Bilinkevicius
Anyone know how to display a modal form in a DLL file? Whenever I try, the modal
form shows up on the taskbar and stays on top, even when you switch to other
windows.
Answer:
1 2 procedure ShowDLLForm(appHandle: HWND); stdcall;
3 begin4 if appHandle = 0 then5 apphandle := GetActiveWindow;
6 application.handle := appHandle;
7 try8 with TDLLForm.Create(Application) do9 try10 ShowModal
11 finally12 free;
13 end14 except15 on E: Exception do16 application.HandleException(E);
17 end;
18 application.handle := 0;
19 end;