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.

Denis


On 01/02/2018 13:31, Sven Barth via fpc-devel wrote:
Am 01.02.2018 14:08 schrieb "Denis Kozlov" <dez...@gmail.com <mailto:dez...@gmail.com>>:

    A proposal:
    1) Use windirs.GetWindowsSpecialDir in fpttf.pp, which already
    uses a more backwards compatible SHGetFolderPath().
    2) Optionally, improve windirs.GetWindowsSpecialDir to use a newer
    SHGetKnownFolderPath() when it is available.

    If this is suitable, I can produce a patch for both.


I would be in favor of this, especially as it hides the gritty details from fpttf.pp.
Report them as two separate issues, please.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to