Not sure if this will work with D2007; this happens in D7. Can you try the following?
type
THackPopupList = class(TPopupList)
private
FActuallyClicked: Boolean;
protected
procedure WndProc(var Message: TMessage); override;
public
property ActuallyClicked: Boolean read FActuallyClicked;
end;
{ THackPopupList }
procedure THackPopupList.WndProc(var Message: TMessage);
begin
FActuallyClicked := Message.Msg = WM_COMMAND;
inherited WndProc(Message);
end;
{ TForm1 }
procedure TForm1.MenuFileOpenClick(Sender: TObject);
var
ActuallyClicked: Boolean;
begin
ActuallyClicked := THackPopupList(PopupList).ActuallyClicked;
...
end;
initialization
PopupList.Free;
PopupList := THackPopupList.Create;
end.
Explanation: OnClick caused by a hang is triggered by WM_INITMENUPOPUP, but this click, triggered by a mouse click, is triggered by this WM_COMMAND.
, Menus.pas . , Delphi, , .