Via Delphi 10.2.3: TTaskDialog always opens positioned at screen center, and since it doesn't have a Position property, there doesn't appear to be a straightforward way to override that behavior. I want all my TTaskDialogs to position at poMainFormCenter. Short of writing a replacement for TTaskDialog, Is there a way to force this behavior?
You might not be aware of the
Flags
property and thetfPositionRelativeToWindow
flag:Strictly speaking, this positions the task dialog relative to the parent form, not the main form, but I suspect this is what you actually do want.
The
tfPositionRelativeToWindow
flag maps to theTDF_POSITION_RELATIVE_TO_WINDOW
flag of the underlying API call toTaskDialogIndirect
: