1

Using Delphi 2010, I am trying to write my own component to save a form's size, position, and state to the Registry.

How can I go about taking user of the application into account or not?

Is there specific keys\ reg paths i use to do this?

Say i want a component property that controls whether to store by user or all users

thanx

IElite
  • 1,818
  • 9
  • 39
  • 64
  • 4
    There is no location in the registry suitable for settings to be shared between all users. The parts of the registry that are shared, are read-only for standard users. For such settings you need to create an app specific sub-folder of `CSIDL_COMMON_APPDATA` at installation time and give it an ACL that permits standard users to write to it. – David Heffernan Feb 10 '12 at 19:46
  • 2
    Maybe a duplicate of [Best Practices for Storing User Preferences and Settings in Win32 Delphi](http://stackoverflow.com/questions/6883779/what-are-the-best-practices-for-storing-user-preferences-and-settings-in-win32-d) – Ken White Feb 10 '12 at 20:03
  • +1 This is a good subject to know about. Plenty of legacy applications which are being upgraded to be compatible with Vista + need to implement this change. – Jerry Dodge Feb 11 '12 at 02:59
  • 2
    @DavidHeffernan, The same approach could be done with setting ACL permissions for `HKEY_LOCAL_MACHINE\Software\YourApp\Public` at installation time to store application settings. BUT storing user preferences (such as form position) should be done in `HKEY_CURRENT_USER` IMHO. – kobik Feb 11 '12 at 12:18
  • @kobik ACLs should not be used on registry. Too obscure. – David Heffernan Feb 11 '12 at 12:20
  • @DavidHeffernan, If its good enough for MS it's good enough for me. – kobik Feb 11 '12 at 12:22
  • OK, i understand all your concerns, however, i do not to store the info in the registry, and I need to take into consideration all users, so if someone can post an answer, as to the best Root Key and path to store the info in, id be happy to accept their answer (assuming its right of course ) – IElite Feb 21 '12 at 13:12

0 Answers0