This is only a partial answer, but I really enjoy referencing the Windows Vista User Experience/Interaction Guide (there's a pdf link for the whole thing too). Most of it, of course, is directed at matching your application's look and feel to fit in with Vista.
Some of it, though, applies universally - especially the sections on the differences of warnings, errors, and other messages, and when to use each. I find myself checking those guidelines every time I work on something that's going to make a pop-up - and the guide doesn't pull any punches when getting after Microsoft programs for breaking these guidelines.
I don't know of a guide like this that exists for Windows XP.