Forum > Suggestions

[SOLVED] Single instance of SHGFI_* constants

<< < (2/3) > >>

Bart:
File a bugreport (reference this topic) and I'll see if I can clear it up some more.
--- Quote from: marcov on September 11, 2023, 03:45:37 pm ---Yes, cleaned up a lot, but SHGFI_* is still there, and in shellapi since 2008

--- End quote ---
This is since which fpc version (Lazarus supports 3.2.0 and higher)?

Bart

marcov:

--- Quote from: Bart on September 11, 2023, 10:06:46 pm ---File a bugreport (reference this topic) and I'll see if I can clear it up some more.
--- Quote from: marcov on September 11, 2023, 03:45:37 pm ---Yes, cleaned up a lot, but SHGFI_* is still there, and in shellapi since 2008

--- End quote ---
This is since which fpc version (Lazarus supports 3.2.0 and higher)?

--- End quote ---

As far I can see they were already there in 2008.  Something goes wrong in the history there (probably the GIT migration tool didn't pick up SVN move/renames of old versions).   So 2.4.0 or earlier.

But maybe somebody expected them to be in windows rather than shellapi. In very old versions much more was in unit windows, so they might not have been used to looking further.

lagprogramming:

--- Quote from: AlexTP on September 10, 2023, 09:58:21 pm ---So in FPC names are declared in
a. WinCE unit
b. Win32 unit
It is ok for me, WinCE and WIn32 maybe don't have lot of common units.

--- End quote ---
The rtl directory of Free Pascal has the following subdirectories: win, win16, win32, win64 and wince. Notice that the constants are declared in wince and packages/winunits-base/. Not in the win32 directory.

lagprogramming:
I've searched for "SHGFI_" in the Lazarus directory.
1/3 The declarations of SHGFI_SMALLICON, SHGFI_LARGEICON and SHGFI_ICON have been removed from both lcl/interfaces/win32/win32extra.pas and lcl/interfaces/customdrawn/customdrawn_winextra.pas files because they are declared in fpc twice already. 3rd party applications build with Lazarus should use the shellapi unit provided by fpc.
2/3 The constants are used in the lcl/interfaces/win32/win32wsshellctrls.pp file but the removal of the declarations won't affect it because this unit already has shellapi in the uses clause.
3/3 The constants are used in the lcl/interfaces/win32/win32themes.pas file reason why the shellapi unit has been added to the uses clause of the implementation.
Test the patch and if it's ok you can apply it to the official sources.

AlexTP:
Reported to https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40674

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version