I'm using a system tray icon in witch a popup menu will appear. I want to generate the items in this menu at runtime. I'm using the following code:
TMenuItem *mi1 = new TMenuItem(PopupMenu2);
PopupMenu2->Items->Items[i]->OnClick = MyFunction;
void __fastcall TForm1::MyFunction(TObject *Sender)
Note: The items that will apear on the menu are stored in data witch is a 50 element AnsiString array with some NULL elements(that aren't supose to appear in the menu).
This code works fine (the menu I want does apear) but I'd like to know witch item in the menu was clicked when the "MyFunction" code is executed.
I'm using BCB4.