Here's a function I wrote. Pretty much all it does is call MessageBoxW, but it uses strings instead of constants because I like that better :P I've made revisions to it but I can't find the file.
Usage:
Handle - integer; if this is the handle of a window, the message box will be created in that window and the window will be disabled until the message box is clicked. Set this to 0 to not disable any window.
Title - string; the text to display in the titlebar
Body - string; the text to display in the body of the messagebox
Icon - string; either "none", "error", "question", "warning", or "info"
Buttons - string; either "ok", "ok-cancel", "abort-retry-ignore", "yes-no-cancel", "yes-no", "retry-cancel", or "cancel-tryagain-continue"
code:
Alert(0,"Look!","hi","info","ok"); // will return "ok" (string) when the ok button is clicked
code:
function Alert(Handle,Title,Body,Icon,Buttons){
if(Icon == null){Icon = 0;}
if(Icon == "none"){Icon = 0;}
if(Icon == "error"){Icon = 16;}
if(Icon == "question"){Icon = 32;}
if(Icon == "warning"){Icon = 48;}
if(Icon == "info"){Icon = 64;}
if(Buttons == null){Buttons = 0;}
if(Buttons == "ok"){Buttons = 0;}
if(Buttons == "ok-cancel"){Buttons = 1;}
if(Buttons == "abort-retry-ignore"){Buttons = 2;}
if(Buttons == "yes-no-cancel"){Buttons = 3;}
if(Buttons == "yes-no"){Buttons = 4;}
if(Buttons == "retry-cancel"){Buttons = 5;}
if(Buttons == "cancel-tryagain-continue"){Buttons = 6;}
var e = Interop.Call("User32", "MessageBoxW", Handle, Body, Title, Icon + Buttons);
switch(e){
case 1: return "ok";
case 2: return "cancel";
case 3: return "abort";
case 4: return "retry";
case 5: return "ignore";
case 6: return "yes";
case 7: return "no";
case 10: return "tryagain";
case 11: return "continue";
}
}