[Qt-interest] Windows 7 and VirtualStore woes

Pascal Patry iscy at invalidip.com
Fri Sep 11 22:52:39 CEST 2009


On Friday 11 September 2009 15:54:37 Oliver Demetz wrote:
> Hi all
>
> First of all let me thank you all for this vital discussion on the topic.
>
> I have accepted grudginly that writing to the "Program Files" directory
> is not really liked on Windows. ok.
> So I followed Scott Aarons hint to use
> QDesktopServices::storageLocation(QDesktopServices::DataLocation)
>
> BUT:
> This still does not give me a location where all system users are
> allowed to write (at least on my Windows 7 RC1 box), it gives me a path
> inside the homedir of the current user!
>
> So my problems would now be solved if I could get somehow the same path
> in the All Users directory tree.
>
> Any idea?

What you are looking for is the "SHGetFolderPath()" function from the win32 
api.

Pass-in this CSIDL: CSIDL_COMMON_APPDATA

That will give you a path where all users can write and it will work on these 
OS.




More information about the Qt-interest-old mailing list