TWinControl.HelpContext properties are not applied to Windows
Original Reporter info from Mantis: Kon.pasc
-
Reporter name: Kon Golovatzkiy
Original Reporter info from Mantis: Kon.pasc
- Reporter name: Kon Golovatzkiy
Description:
SVN revision 22358.
OS-Windows.
In main loop on message WM_HELP we always receive zero in
LPHELPINFO(LParam)^.dwContextId regardless we set HelpContext properties of all controls on the form.
Somewhere in Win32/64 LCL code there should be API calls SetWindowContextHelpId() and SetMenuContextHelpID() so Windows will know how to fill LPHELPINFO(LParam).
I had to enumerate all TWinControl descendants and apply these API functions in FormCreate event to make help working. :(
Additional information:
To test the issue we can define
Application.OnHelp:=MyHLP;{Application.OnHelp is called on WM_HELP}
where MyHLP is like this:
function TMyHLP.MyHLP(Command: Word; Data: PtrInt; var CallHelp: Boolean): Boolean;
var _pHelpInfo: LPHELPINFO;
begin
if Data<>0 then begin
_pHelpInfo:=LPHELPINFO(Data);
if _pHelpInfo<>nil then begin
// here we always receive _pHelpInfo^.dwContextId=0
//..some code goes here....
CallHelp:=False;
end;
end;
Result:=True;
end;
Mantis conversion info:
- Mantis ID: 15065
- Version: 0.9.29 (SVN)
- Fixed in version: 0.9.29 (SVN)
- Fixed in revision: 26744 (#35a4f8ad)
- Target version: 1.0.0
- LazTarget: 1.0