On Tue, 6 Feb 2018, Denis Kozlov wrote:

Improved windirs.GetWindowsSpecialDir is ready:
https://bugs.freepascal.org/view.php?id=33133

The submitted patch contains the following changes:
1. Added FOLDERID_* constants, required for SHGetKnownFolderPath.
2. Added mapping of legacy CSIDL_* constants to FOLDERID_* constants.
3. Overloaded GetWindowsSpecialDir to work with both CSIDL_* or FOLDERID_* constants. 4. Changed GetWindowsSpecialDir to fallback to an alternative API (using appropriate remapping of parameters) when the default API function is not available.

Existing code that uses GetWindowsSpecialDir(CSIDL_*) should not be affected, except for an improved forward compatibility when the deprecated SHGetFolderPath is finally removed from Windows API, in which case a newer API function will be used automatically.

I would have preferred that you always use the new function when available, but
since you'd then be doing what Microsoft is already doing, so I won't make
a point out of it. I will apply and test the patch, thank you.

Michael.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to