mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-04 19:19:26 +01:00
LCL, Win32: Read message data correctly. Affected keyboard accelerators when compiled with -O2. Issue #26562, patch from ChrisF.
git-svn-id: trunk@47048 -
This commit is contained in:
parent
8b469d68e9
commit
1ad0f9600a
@ -272,6 +272,7 @@ var
|
|||||||
TmpSize: TSize; // used by WM_MEASUREITEM
|
TmpSize: TSize; // used by WM_MEASUREITEM
|
||||||
Info: TComboboxInfo;
|
Info: TComboboxInfo;
|
||||||
OrgCharCode: word; // used in WM_CHAR handling
|
OrgCharCode: word; // used in WM_CHAR handling
|
||||||
|
CharCodeNotEmpty: boolean; // used by WM_CHAR, WM_SYSCHAR and WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, WM_SYSKEYUP
|
||||||
|
|
||||||
function GetMenuParent(ASearch, AParent: HMENU): HMENU;
|
function GetMenuParent(ASearch, AParent: HMENU): HMENU;
|
||||||
var
|
var
|
||||||
@ -2599,10 +2600,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
case Msg of
|
||||||
|
WM_CHAR, WM_SYSCHAR:
|
||||||
|
CharCodeNotEmpty := (LMChar.CharCode<>0);
|
||||||
|
else
|
||||||
|
CharCodeNotEmpty := (LMKey.CharCode<>0);
|
||||||
|
end;
|
||||||
// we cannot tell for sure windows didn't want the key
|
// we cannot tell for sure windows didn't want the key
|
||||||
// for WM_CHAR check WM_GETDLGCODE/DLGC_WANTCHARS
|
// for WM_CHAR check WM_GETDLGCODE/DLGC_WANTCHARS
|
||||||
// winapi too inconsistent about return value
|
// winapi too inconsistent about return value
|
||||||
if (lWinControl <> nil) and (PLMsg^.Result = 0) and (LMKey.CharCode<>0) then
|
if (lWinControl <> nil) and (PLMsg^.Result = 0) and CharCodeNotEmpty then
|
||||||
DeliverMessage(lWinControl, PLMsg^);
|
DeliverMessage(lWinControl, PLMsg^);
|
||||||
|
|
||||||
// handle Ctrl-A for edit controls
|
// handle Ctrl-A for edit controls
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user