Advertisement
TLama

Untitled

Jan 29th, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.54 KB | None | 0 0
  1. type
  2.   TFileOpenDialog = class(Dialogs.TFileOpenDialog)
  3.   protected
  4.     function SelectionChange: HRESULT; override;
  5.   end;
  6.  
  7. implementation
  8.  
  9. { TFileOpenDialog }
  10.  
  11. function TFileOpenDialog.SelectionChange: HRESULT;
  12. var
  13.   Attrs: DWORD;
  14.   ShellItem: IShellItem;
  15. begin
  16.   Result := inherited;
  17.   if Succeeded(Dialog.GetCurrentSelection(ShellItem)) and
  18.     Succeeded(ShellItem.GetAttributes(SFGAO_FOLDER, Attrs)) and (Attrs = SFGAO_FOLDER) then
  19.   begin
  20.     // folder is selected
  21.   end
  22.   else
  23.   begin
  24.     // file is selected
  25.   end;
  26. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement