LCLIntf: add helper functions to extract Lo and Hi words of LPARAM type.

This commit is contained in:
Bart 2023-08-27 10:26:16 +02:00
parent 935e7edaff
commit c70e6b3297
2 changed files with 22 additions and 0 deletions

View File

@ -1515,6 +1515,24 @@ function MakeWParam(l, h: Word): WPARAM; inline;
begin
Result := MakeLong(l, h);
end;
{
Does the reverse of the MakeLParam function
}
procedure LParamExtractLoHiWord(const aParam: LPARAM; out LoWord, HiWord: Word);
begin
LoWord := aParam and $FFFF;
HiWord := (aParam and $FFFF0000) shr 16;
end;
function LParamHiWord(const aParam: LPARAM): Word;
begin
Result := (aParam and $FFFF0000) shr 16;
end;
function LParamLoWord(const aParam: LPARAM): Word;
begin
Result := aParam and $FFFF;
end;
{------------------------------------------------------------------------------
Function: OffsetRect

View File

@ -336,6 +336,10 @@ function MakeWParam(l, h: Word): WPARAM; inline;
function MakeLParam(l, h: Word): LPARAM; inline;
function MakeLResult(l, h: Word): LRESULT; inline;
procedure LParamExtractLoHiWord(const aParam: LPARAM; out LoWord, HiWord: Word);
function LParamHiWord(const aParam: LPARAM): Word; inline;
function LParamLoWord(const aParam: LPARAM): Word; inline;
// Deprecated in version 2.3, 2023-06.
function OffsetRect(var Rect: TRect; dx,dy: Integer): Boolean; deprecated 'Use Types.OffsetRect instead';