title: How to center a Delphi form on a 4k screen? (Windows scaling enabled) - poScreenCenter not working
body: <p>I have a Delphi form functioning as a sort of splash screen (i.e. borderless) that I want to appear exactly in the center of the (main) screen (currently using TForm1.Position := poScreenCenter to achieve this).</p>
  <p>This is not working on 4k monitors with scaling (or any screen really that uses a percentage higher than 100% in Windows (Settings &gt; Display &gt; Scale and Layout)). In such cases, the form will pop up <em>more in the upper left-hand corner</em> rather than the exact middle of the screen. This seems like a HiDPI-related bug in Delphi, as the program looks otherwise fine and works well.</p>
  <p>My guess is that I would have to set TForm1.Position to poDesigned and manually set TForm1.Top and Left in the OnShow event. The question is: To what? What would be a universal solution to ensure that the form always appears in the exact screen center, regardless of monitor size / resolution / scaling etc. I have stumbled across a function called &quot;muldiv&quot; that may be of help but I am unsure how to use it.</p>
  <p>I have:</p>
  <ul>
  <li>Delphi 10.3 Version 26.0.36039.7899</li>
  <li>Windows 10 Version 20H2</li>
  <li>DPI awareness (Project &gt; Options &gt; Application &gt; Manifest) set to &quot;System Aware&quot;</li>
  <li>TForm1.Scaled set to &quot;True&quot;</li>
  <li>TForm1.PixelsPerInch set to &quot;96&quot;</li>
  <li>TForm1.FormStyle set to &quot;fsStayOnTop&quot;</li>
  <li>TForm1.BorderStyle set to &quot;bsNone&quot;</li>
  <li>TForm1.Position set to &quot;poScreenCenter&quot;</li>
  <li>TFrom1.DefaultMonitor set to &quot;dmActiveForm&quot;</li>
  <li>TForm1.Width and Height both set to &quot;480&quot;</li>
  </ul>
  <p>Thanks for your help.</p>