AdvMessageDlg not centered on current form

I have a child form of my application main form. This child form can be positioned on another monitor and restores it's position from the previous state. If an error condition exists, I throw up a message using AdvMessageDlg however the dialog appears centered on the main form on the other monitor, not the child form.

How do I tell AdvMessageDlg to use the active form as it's parent?

Laurence Bevan
New Zealand

Delphi 7 on Windows 7

This is the default setting. There is not a way to instruct a function call like AdvMessageDlg() to change this.

To change this, you'd need to change the code in 

function AdvMessageDlg(const Instruction: string; DlgType: TMsgDlgType;
  Buttons: TMsgDlgButtons; HelpCtx: Longint; DefaultButton: TMsgDlgBtn): Integer; overload;

in TaskDialog.pas

and add the code:

td.DialogPosition := dpOwnerFormCenter;