The MsgPlus::CreateWnd function creates a new window based on an Interface XML file. For more information, see Windows for your Script.
[object] CreateWnd( [string] XmlFile, [string] WindowId, [number,optional] Options );
[number,optional] If specified, this parameter can be one of the following numbers:
WNDOPT_NORMAL (0)
WNDOPT_INVISIBLE (1)
WNDOPT_NOACTIVATE (2)Display the window normally (default)
Don't show the window after it's been created
Don't activate the window after its creation
The following flags can also be added to specify additional characteristics:
WNDOPT_RTL (128)
Display the window with a right-to-left layout (if supported by the system).
Requires Messenger Plus! 4.10 or above.
A PlusWnd object that you can use to control every aspect of the new window. If the window cannot be created, the return value is null.
This function typically fails for the following reason:
Interface XML files should always be validated for both syntax and compliance with the interface windows' schema file. In some occasions, the file can appear to be validated but still fail to load. This can be caused by a missing required attribute (like Height for some controls), duplicated control/element identifiers and other runtime specific reasons.
Images specified in a script's interface file are searched in two places. First, Messenger Plus! looks in the "Images" sub-directory of the script's directory. That's where you should store all your custom made pictures. If the image cannot be found there, Messenger Plus! looks in its own resources for a matching name. This can be useful to reuse pictures seen in Messenger Plus! windows without having to bundle them with your script. Be careful to check if the images are still there when an update of Messenger Plus! is released though.
You should refrain from creating windows when the user has enabled Messenger Lock. This can be checked with MessengerIsLocked.
Messenger Plus! 4.23 and earlier: enumeration names are not available, numbers must be used instead.
Object | MsgPlus |
---|---|
Availability | Messenger Plus! Live 4.00 |
MsgPlus Object, Windows for your Script, Interface Windows Reference.