Ich weiß, is schon alt, aber da ich auch danach suchte....
http://delphi.about.com/od/vclusing/a/menuitemhints.htm
Theoretisch müßte es so dann doch funktionieren.
Delphi-Quellcode:
var MenuHintWindow : THintWindow;
procedure THauptForm.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean);
var
SubMenu : HMENU;
MenuItem : TMenuItem;
HintPos : TRect;
begin
if (Msg.message = WM_MENUSELECT) and (({MenuFlag}HIWORD(Msg.wParam) <> $FFFF) or ({IDItem}LOWORD(Msg.wParam) <> 0)) then begin
if {MenuFlag}HIWORD(Msg.wParam) and MF_POPUP <> 0 then begin
SubMenu := GetSubMenu(HMENU(Msg.lParam), {IDItem}LOWORD(Msg.wParam));
MenuItem := Self.Menu.FindItem(SubMenu, fkHandle);
end else
MenuItem := Self.Menu.FindItem({IDItem}LOWORD(Msg.wParam), fkCommand);
if MenuItem.Hint <> '' then begin
if not Assigned(MenuHintWindow) then
MenuHintWindow := TGenerics.IfThen<THintWindowClass>(Assigned(HintWindowClass), HintWindowClass, THintWindow).Create(Self);
HintPos.TopLeft := Mouse.CursorPos;
HintPos.TopLeft := Point(HintPos.Left + 16, HintPos.Top + 16);
HintPos.BottomRight := Point(HintPos.Left + Canvas.TextWidth(MenuItem.Hint), HintPos.Top + Canvas.TextHeight(MenuItem.Hint));
MenuHintWindow.ActivateHint(HintPos, MenuItem.Hint);
end else
Application.HideHint;
Handled := True;
end;
end;
Aber WM_MENUSELECT wird nicht aufgerufen, wenn ich die Maus über dem Popup-Menü bewege.
Auch beim direkten Weg kommt nichts an.
Delphi-Quellcode:
private
procedure WMMenuSelect(var Msg: TWMMenuSelect); message WM_MENUSELECT;
end
Gut, könnte ja sein, daß es an das TPopupMenu gesendet wird und nicht an die TForm, aber dann müßte es doch dennoch am TApplicationEvent.OnMessage (Application.OnMessage) vorbeikommen.
Ein Therapeut entspricht 1024 Gigapeut.