Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type
- TFileOpenDialog = class(Dialogs.TFileOpenDialog)
- protected
- function SelectionChange: HRESULT; override;
- end;
- implementation
- { TFileOpenDialog }
- function TFileOpenDialog.SelectionChange: HRESULT;
- var
- Attrs: DWORD;
- ShellItem: IShellItem;
- begin
- Result := inherited;
- if Succeeded(Dialog.GetCurrentSelection(ShellItem)) and
- Succeeded(ShellItem.GetAttributes(SFGAO_FOLDER, Attrs)) and (Attrs = SFGAO_FOLDER) then
- begin
- // folder is selected
- end
- else
- begin
- // file is selected
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement