What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » MessageBox parameters/flags

MessageBox parameters/flags
Author: Message:
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: MessageBox parameters/flags
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 :)

This post was edited on 06-27-2006 at 12:27 AM by deAd.
06-27-2006 12:25 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
MessageBox parameters/flags - by mathieumg on 06-26-2006 at 02:06 PM
RE: MessageBox parameters/flags - by matty on 06-27-2006 at 12:23 AM
RE: MessageBox parameters/flags - by deAd on 06-27-2006 at 12:25 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On