The Sample User Interface Guidelines section presents several useful guidelines for message boxes and error messages.
Discusses feedback interfaces and gives several examples. Of the feedback interfaces, message boxes are the most obtrusive.
Discusses why unnecessary dialog boxes are undesirable, how to identify unnecessary dialog boxes, and how to eliminate them.
Gives a list of useful items to check to make sure that your error messages are necessary, helpful, informative, and easy to understand.