Work out attributes

I need to work out the attributes for a file.
I use the GetFileAttributes API call.
How do I work out which attributes are set,
from the returned Long variable.
I know I can use If's for every combination but there must be
an easier (lazier) way.

Thanks