Search code examples
delphipropertiesmenuright-click

Show the default right-click menu - Delphi


I have a Listbox which contain a list of files . can i access the Windows right-click menu in the listbox to access the open , properties , delete and rename items ?


Solution

  • Kermia check the JclShell unit from the JEDI JCL library, inside of this unit exist a function called DisplayContextMenu which show the context menu associated to a file. this function encapsulate the calls to the IContextMenu interface and makes your work more easy.

    function DisplayContextMenu(const Handle: HWND; const FileName: string;
      Pos: TPoint): Boolean;