I want to write the following procedure / function:
procedure ShowSysPopup(aFile: string; x, y: integer);
Which will build and show (at the coordinates x and y) the right-click shell menu which one sees in the Windows Explorer for the given file. I’m not so interested in the ‘showing’ part but more in how one can build such a menu.
I’ve made a quick solution for you.
add these units to the “Uses” section:
and here is your procedure, I just add new parameter “HND” to carry the handle of the TWinControl that you will use to display the context Menu.
modify/add the initialization, finalization section like this
and here how you can use this procedure:
I hope this will work for you.
Regards,
Edit:
if you want to show context menu for more than one file check this article in my blog