ImageEn, unit iexWindowsFunctions

PopupSystemMenu


Declaration

function PopupSystemMenu(Handle: HWND; const Filename: String; x, y: integer): Boolean; overload;
function PopupSystemMenu(Handle: HWND; ssFileList: TStrings; x, y: integer): Boolean; overload;
function PopupSystemMenu(Handle: HWND; ssFileList: TStrings; x, y: integer; Flags: LongWord; OnVerbEvent: TIEExplorerVerbEvent): Boolean; overload;


Description

Displays the system menu for the specified files at position x,y. This menu is the same as that displayed when right-clicking a selection of files in Windows Explorer
Use Flags to customize the items of the popup menu using CMF_* consts, such as CMF_CANRENAME. Default is: CMF_EXPLORE or CMF_CANRENAME

Result is false if the item cannot be displayed, e.g. due to an invalid file selection.




Example

PopupSystemMenu( Form1.Handle, ssSelectedFiles, ClickPos.X, ClickPos.Y );

// Show simpler popup menu
PopupSystemMenu( Form1.Handle, ssSelectedFiles, ClickPos.X, ClickPos.Y, CMF_NOVERBS or CMF_CANRENAME, nil );