Shoutbox

MessageBox parameters/flags - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: MessageBox parameters/flags (/showthread.php?tid=61578)

MessageBox parameters/flags by mathieumg on 06-26-2006 at 02:06 PM

I've done a quick search to find numerical equivalent to the flags found in this page: http://msdn.microsoft.com/library/default.asp?url...ons/messagebox.asp but couldn't come up with anything useful. Does someone have an idea of where to find them?


RE: MessageBox parameters/flags by matty on 06-27-2006 at 12:23 AM

code:
var MB_AboutRetryIgnore = 2;
var MB_ApplicationModal = 0;
var MB_Critical = 16;
var MB_Exclamation = 48;
var MB_Information = 64;
var MB_MsgBoxHelpButton = 16384;
var MB_MsgBoxRight = 524288;
var MB_MsgBoxRtlReading = 1048576;
var MB_MsgBoxSetForeground = 65536;
var MB_OkCancel = 1;
var MB_OkOnly = 0;
var MB_Question = 32;
var MB_RetryCancel = 5;
var MB_SystemModal = 4096;
var MB_YesNo = 4;
var MB_YesNoCancel = 3;

RE: MessageBox parameters/flags by deAd on 06-27-2006 at 12:25 AM

I wrote an easy function for messageboxes...

code:
function Alert(Title,Body,Handle,Icon,Buttons){
    if(Handle == "CList"){Handle = Messenger.ContactListWndHandle;}
        else if(Handle == null || Handle == ""){ Handle = 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 == "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";
    }
}

to activate it, just say:
code:
Alert("Title goes here!","Body goes here!",0,"none","yes-no");
Where the red one is the handle. If you make it an existing window's handle, the alert will not show up in the taskbar. Look at the code for more icon/button things :)