According to

the window handle passed to IDBPromptInitialize::PromptDataSource will be used this way:

hWndParent [in]
The parent window handle for dialog boxes to be displayed. The dialog box will always be centered within this window.

This is exactly what I would like, but it doesn't work.
The parent form is on a secondary monitor (left hand side), but the dialog is shown on the primary monitor (right hand side). It works fine when the parent form is on the primary monitor. Anybody got an idea why? Simply a bug in that API?

function TManagedFormConnEditForm.EditConnectionString(_ParentHandle: THandle;
var _ConnectionString: string): Boolean;
DataInit: IDataInitialize;
DBPrompt: IDBPromptInitialize;
DataSource: IUnknown;
InitStr: PWideChar;
s: WideString;
DataInit := CreateComObject(CLSID_DataLinks) as IDataInitialize;
if _ConnectionString <> '' then begin
s := _ConnectionString;
DataInit.GetDataSource(nil, CLSCTX_INPROC_SERVER,
PWideChar(s), IUnknown, DataSource);
DBPrompt := CreateComObject(CLSID_DataLinks) as IDBPromptInitialize;
Result := Succeeded(DBPrompt.PromptDataSource(nil, _ParentHandle,
DBPROMPTOPTIONS_PROPERTYSHEET, 0, nil, nil, IUnknown, DataSource));
if Result then begin
InitStr := nil;
DataInit.GetInitializationString(DataSource, True, InitStr);
_ConnectionString := InitStr;

Called as

procedure TManagedFormConnEditForm.BuildButtonClick(_Sender: TObject);
ConnectionString: string;
ConnectionString := FConnectionStringEdit.Text;
if EditConnectionString(FForm.Handle, ConnectionString) then
FConnectionStringEdit.Text := ConnectionString;
Shared publiclyView activity