TLama

Untitled

Jan 29th, 2014
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.37 KB | None | 0 0
  1. procedure TForm1.FileOpenDialog1SelectionChange(Sender: TObject);
  2. var
  3.   Attrs: DWORD;
  4. begin
  5.   with FileOpenDialog1 do
  6.   begin
  7.     if Assigned(ShellItem) and Succeeded(ShellItem.GetAttributes(SFGAO_FOLDER, Attrs)) and
  8.       (Attrs <> SFGAO_FOLDER) then
  9.     begin
  10.       // file is selected
  11.     end
  12.     else
  13.     begin
  14.       // folder is selected
  15.     end;
  16.   end;
  17. end;
Advertisement
Add Comment
Please, Sign In to add comment