>It returns a 6 because it's written in C and that's how C programmer's think. Return a numeric status value as the result. If you want to return data, pass in a pointer and it will magically update.
Which is why I say it's obsolete. The messagebox is a piece of API, and it's supposed to perform a rather simple function. It can be used, or has wrapper functions for, in dozens of languages. All the millions of folks who call it from their languages are forced to learn, or keep documentation for, those magical numbers, because whoever wrote it was a C++ coder, and that's how things were done in the eighties (when, I guess, messagebox 1.0 was written).
>>I would advise against duplicating it. It's obsolete, limited, riddled with unintuitive numbers (why is, of all things, 6 a "yes"?) and has a fixed number of button combinations. When I see "if you want to do A, press yes, if you want to do B, press no, if C then press cancel", I suspect the rest of the app is just as sloppy.