What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Tool/Developer] MessageBox (Version 1.0)

[Tool/Developer] MessageBox (Version 1.0)
Author: Message:
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
O.P. [Tool/Developer] MessageBox (Version 1.0)
This is another of those scripts made for developers (and another one based on Message Boxes ^o))... It allows you to create your own custom alerts and receive input from the user. All it requires is that you include one extra js file and one extra xml (and some SMALL images (3.29kb)) with your script. It saves the need for all those Interop.Call(s) to MessageBoxW and having to discover the right paramaters (such as which number you need for certain buttons). The syntax for the command is:
code:
function alert(
        sID        [String],                //Unique ID of the MessageBox (for user identification)
        nButtons [Number],                //Number of buttons
        sTitle    [String],                //MessageBox title (RichStaticControl)
        sMessage    [String],                //MessageBox message (RichStaticControl)
        nIcon    [Number],                //1-Information | 2-Question | 4-Exclamation | 8-Critical
        sButton1    [String],                //Button1 Text
        sButton2    [String, Optional],    //Button2 Text
        sButton3    [String, Optional],    //Button3 Text
        nTrans    [Number, Optional],    //Transparancy (Percentage)
);
Even though it says number for some of them, I delberately made it accept strings incase the developer was a n00b :refuck:

As it's just a PlusWnd, it has the same events. To detect a selection or a button press just use:

code:
function OnMessageBoxEvent_CtrlClicked(PlusWnd, ControlId){
...
...
}

This function is already in the js file

I have included the sID paramater so you can distinguish between message boxes (you might have two open at once, if you really need it, and one could be called "error_interop" and the other "savesettings").

Rather than checking for the ControlId in that function I have added a line that retrieves the caption of the button (which is set by you anyway). That way it doesn't get confusing about which buttons were shown and you can check for "Yes" or "No" rather than "btn_1" or "btn_2" etc.

You can also set the transparency of the window (using a function written by Matty) by setting the nTrans param to a number between 0 and 100.

Images can be edited and you can even, with a little bit of tweaking within the script, add more images.

The MessageBox uses RichStaticControls to support colours and other formatting styles.

The window uses the "Flair" style used in stickynotes, even if you can't really see it, I should credit deAd for it

Two Examples of the possibilities:
[Image: msgbox.bmp]

I hope people like it now (just spent 6 hours on it (kinda):p)

.plsc File Attachment: MessageBox.plsc (9.67 KB)
This file has been downloaded 159 time(s).

This post was edited on 12-20-2006 at 01:30 AM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
12-19-2006 06:28 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Tool/Developer] MessageBox (Version 1.0) - by Spunky on 12-19-2006 at 06:28 AM
RE: [Release] MessageBox (Version 1.0) - by RaceProUK on 12-19-2006 at 10:29 AM
RE: [Release] MessageBox (Version 1.0) - by BraydenP on 12-19-2006 at 10:43 AM
RE: [Release] MessageBox (Version 1.0) - by Spunky on 12-20-2006 at 01:28 AM
RE: [Tool/Developer] MessageBox (Version 1.0) - by deAd on 12-20-2006 at 01:58 AM
RE: [Tool/Developer] MessageBox (Version 1.0) - by -dt- on 12-20-2006 at 03:53 AM
RE: [Tool/Developer] MessageBox (Version 1.0) - by Spunky on 12-20-2006 at 11:00 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