{
  It is possible to close a common dialog shown by TCommonDialog.Execute
  (or its overriddens) method while it is visible and application handles messages.
  The solution is:

  Es ist möglich einen TCommonDialog der mit TCommonDialog.Execute geöffnet wurde,
  automatisch zu schliessen während er sichtbar ist. Die Lösung ist:
}


SendMessage(GetParent(OpenDialog1.Handle), WM_SYSCOMMAND, SC_CLOSE, 0);