My first idea when a feature in a third-party unit is not supported on my system is: Remove it, maybe it is not needed (there is lots of ancient unneeded stuff in complicated units!), or I can work around it.
Following this idea, I searched for "shcore.dll" within the DzHtmlText and Dam downloads - it is only found in unit "ScalingUtils", function GetDpiForMonitor. Commented this unit out and compiled the DzHtmlText package to let the compiler help me. The removed function is called by function RetrieveMonitorPPI(F: TCustomForm). Looking at the source code of this function I get the impression, without knowing details, that it seems to determine the PixelsPerInch for the monitor on with the form F is displayed. I do a Ctrl+click on "TCustomForm" to let the IDE open the declaration of TCustomForm for me. Scrolling down a bit I see that there is a property "Monitor: TMonitor" - ah: every form in Lazarus knows the monitor, which which it is displayed! Another Ctrl+click, now on TMonitor, and another scroll down shows that TMonitor has a property PixelsPerInch. Now it is easy: remove the function RetrieveMonitorPPI from "ScalingUtils" and replace it by an equally named function which returns the Result := F.Monitor.PixelsPerInch. A final compilation test - and it seems to work without the shcore.dll.
In summary:
(*
type
TMonitorDpiType = (
MDT_EFFECTIVE_DPI = 0,
MDT_ANGULAR_DPI = 1,
MDT_RAW_DPI = 2,
MDT_DEFAULT = MDT_EFFECTIVE_DPI
);
{$WARN SYMBOL_PLATFORM OFF}
function GetDpiForMonitor(
hmonitor: HMONITOR;
dpiType: TMonitorDpiType;
out dpiX: UINT;
out dpiY: UINT
): HRESULT; stdcall; external 'Shcore.dll' {$IFDEF DCC}delayed{$ENDIF};
{$WARN SYMBOL_PLATFORM ON}
function RetrieveMonitorPPI(F: TCustomForm): Integer;
var
Ydpi: Cardinal;
Xdpi: Cardinal;
DC: HDC;
begin
if CheckWin32Version(6,3) then
begin
if GetDpiForMonitor(F.Monitor.Handle, TMonitorDpiType.MDT_EFFECTIVE_DPI, Ydpi, Xdpi) = S_OK then
Result := Ydpi
else
Result := 0;
end
else
begin
DC := GetDC(0);
Result := GetDeviceCaps(DC, LOGPIXELSY);
ReleaseDC(0, DC);
end;
end;
*)
function RetrieveMonitorPPI(F: TCustomForm): Integer;
begin
Result := F.Monitor.PixelsPerInch;
end;
I normally work with Laz/main, but checked back to v2.0.12 and found that this patch works at least back to this version, probably even with older ones.
The patch seems to be needed for high-dpi handling. But since the packages are primarily written for Delphi, I doubt whether they handle high-res monitors in the correct way for Lazarus. But even if this - or my entire patch - would not work you will certainly be able to compile and install the dam package now.
[P.S.]
There were two additional error messages when compiling the Dam package, related to some "Styleelements" property. You can safely remove them (or put them into a {$IFNDEF FPC}...{$ENDIF} directive).