Parented Dialogs revisited - taskbar switch not working

Hi All -

I posted a question some time ago here regarding making a form
contained in a .DLL part of a parent application. The parent
application does not use VCL, and after some messing around I
discovered that

  Setup := TSetup.CreateParented(GetLastActivePopup(GetMainWnd));

followed by


would indeed create a dialog box that belonged to the last modal
dialog displayed by the application (Premiere). Premiere provides the
GetMainWnd function which returns a handle to the main Premiere

The problem now is that although I have got rid of the separate icon
my dialog was placing on the Windows taskbar, now I find that clicking
the Premiere taskbar icon has no effect when my dialog is displayed.

I've tried assigning GetMainWnd or GetLastActivePopup(GetMainWnd) to
Application.Handle, but this just results in the window with the
assigned handle disappearing when my dialog closes.

The C code in the Premiere toolkit uses

  result = DialogBoxParam(resInst, MAKEINTRESOURCE(1000),
    (DLGPROC)AskDlogProc, (LPARAM)theData);

and I've verified that this works. So what is Delphi doing
differently? At least the program is useable now, but I'd dearly like
to know what's going on here.

Keith Johnson
Xentrik Software