The items in TPopupMenu can be highlighted/selected with keyboard or mouse. When selected with keyboard, you can move in the menu with the arrow keys.
How to mark the 1st menu item as selected (blue) without simulating the down arrow keypress with VK_DOWN (see code below)?
Popup := TPopupMenu.create(nil);
Popup.OnPopup := PopupClick;
class procedure TTrayMain.PopupClick(Sender: TObject) ;
begin
// Code below activates the first menu entry..
// Now Looking for an alternative solution to replace this hack:
keybd_event( VK_DOWN, MapVirtualKey( VK_DOWN,0), 0, 0);
keybd_event( VK_DOWN, MapVirtualKey( VK_DOWN,0), KEYEVENTF_KEYUP, 0);
end;