Remembering an Application’s Size and Position on Multiple Screens

David Hoyle just blogged about this topic (go ahead, read it first but remember to come back. 😉 )

Welcome back.

I think he is making two mistakes here (for suitable definitions of “mistake”):

  1. Don’t store the form positions in an ini file, use the registry. These positions make sense only on the same computer. They don’t need to be portable and if they get lost, it’s no big deal.
  2. And if these settings are stored in the registry, all of a sudden, it doesn’t matter whether it is a single or multi monitor setup. Just store the absolute position and be done.

You still need to handle the case that the stored position is outside the visible area, e.g. the monitor is no longer available, the monitor position has been changed, or the monitor settings have been changed.

All the above does not apply to other settings of a program, you might still want to store these in INI files to make them portable.

Of course, this is just my opinion, you have the right to disagree. 😉

This post caused some comments in the English Delphi Praxis forum.