FileMatchesMask Method
Checks whether a particular file or directory name matches the specified mask.
function FileMatchesMask(Mask: String; FileName: String; CaseSensitive: Boolean): Boolean;
Remarks
This method checks whether the file or directory name specified by FileName matches Mask; if it does, this method returns True. The CaseSensitive parameter controls whether a case-sensitive match should be performed.