NMHDR record member constants itself are declared as signed integers (probably legacy) but the winapi NMHDR expects longword members. Hence the compiler barks.
(/win/wininc/struct.inc is correct, messages.inc isn't)
To suppress, cast to longword on use as a work-around.
Solution is possibly to redeclare
const
HDM_TESTDUMMY = longword(-321); // instead of HDM_TESTDUMMY = -(321)
var i:longint;
j:longword;
begin
i:=HDM_TESTDUMMY; // testlongword.pas(6,8) Warning: Range check error while evaluating constants (4294966975 must be between -2147483648 and 2147483647)
j:=HDM_TESTDUMMY; // OK.
writeln(i,'|',j);
end.
Is that enough context?
[edit]
reported in Mantis as #0035324
p.s. the example actually reverses the issue to make it clear.