How do you detect whether the user pressed cancel when using common dialog boxes?

Alex