What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » creat window

creat window
Author: Message:
desithugg
New Member
*


Posts: 4
– / Male / Flag
Joined: Mar 2008
O.P. creat window
Hi well i'm just starting out with scripting and i'm having some trouble creating a window. I followed the Scripting documentation but it doesn't seem to be working.

Here's the xml window code (name: saad.xml)
code:
<Interfaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">    <Window Id="WndTest" Version="1">        <Attributes>            <Caption>Test Window</Caption>
        </Attributes>
        <TitleBar>
            <Title><Text>Hello!</Text></Title>
        </TitleBar>
        <Position ClientWidth="170" ClientHeight="45"/>
        <DialogTmpl/>
        <Controls>
            <Control xsi:type="StaticControl" Id="LblTop">
                <Position Left="10" Top="10" Width="150"/>
                <Caption>Hello world!</Caption>
            </Control>
            <Control xsi:type="ButtonControl" Id="BtnClose">
                <Position Left="115" Top="25" Width="50"/>                <Caption>Close</Caption>
            </Control>
        </Controls>
    </Window>
</Interfaces>

and here's the script
code:
function OnEvent_Initialize(MessengerStart){
    var Wnd = MsgPlus.CreateWnd("saad.xml", "form1");
    MsgPlus.DisplayToast("testing","testing...");
}

I placed the xml file in the script directory, but it doesn't work. By the way the toast does show.
03-30-2008 01:03 AM
Profile E-Mail PM Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: creat window
var Wnd = MsgPlus.CreateWnd("saad.xml", "WndTest");
03-30-2008 01:10 AM
Profile PM Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
RE: creat window
In the JS code you wrote, you're not opening the window that you wrote above in the XML.
code:
var Wnd = MsgPlus.CreateWnd("saad.xml", "form1");
That needs to be changed to "WndTest", the same as the Id name you gave it in the XML.
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
03-30-2008 01:10 AM
Profile PM Web Find Quote Report
desithugg
New Member
*


Posts: 4
– / Male / Flag
Joined: Mar 2008
O.P. RE: creat window
ohh got it, thanks!

no luck :S i made sure the names match now and still won't work

This post was edited on 04-13-2008 at 11:01 PM by WDZ.
03-30-2008 01:13 AM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: creat window
Make sure you have saved the XML as a unicode file and that it is placed in the script's directory.

;)

-----------

@Patchou
This is maybe something to be added to the scripting docs: files must be saved as unicode. At first glance I don't see a mention of that anywhere, certainly not in the basic sections like "getting started" or "examples" section or something.

This post was edited on 03-30-2008 at 02:17 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-30-2008 02:07 AM
Profile PM Find Quote Report
desithugg
New Member
*


Posts: 4
– / Male / Flag
Joined: Mar 2008
O.P. RE: creat window
Hey thanks, that was the problem. I had it saved as ANSI, thanks a lot. Was going crazy over that. I can finally do something now.
03-30-2008 02:17 AM
Profile E-Mail PM Find Quote Report
hitokiri_3
New Member
*


Posts: 2
40 / Male / Flag
Joined: Apr 2008
RE: creat window
hello,
I have the same problem but i don't know if my xml file is an ANSI or an Unicode.
My editor is Context.
Could you help me?
04-13-2008 10:37 PM
Profile E-Mail PM Find Quote Report
desithugg
New Member
*


Posts: 4
– / Male / Flag
Joined: Mar 2008
O.P. RE: RE: creat window
quote:
Originally posted by hitokiri_3
hello,
I have the same problem but i don't know if my xml file is an ANSI or an Unicode.
My editor is Context.
Could you help me?

Hey umm try this open notepad, copy your xml code in there and click File > Save As
enter the file name and than where it says encoding select unicode
04-13-2008 10:43 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: creat window
I've quickly installed ConTEXT (looks like a pretty neat editor :P), and after a quick search, I found the option to set the save format:
  1. In the menu bar, choose Options > Environment Options...
  2. Open the tab "Editor"
  3. In the "File format" drop-down, choose "Unicode".
    [Image: attachment.php?pid=902655]
  4. Click OK. :)
Now, when you save a file, it'll be saved as Unicode. Pay attention to this when you're using it for other projects too (C++, PHP,...) as those languages may not like Unicode, then you'll have to switch that option back to DOS for those cases.

.png File Attachment: ConTEXT-SaveUnicode.png (7.5 KB)
This file has been downloaded 207 time(s).

This post was edited on 04-14-2008 at 04:30 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
04-14-2008 04:27 PM
Profile E-Mail PM Web Find Quote Report
hitokiri_3
New Member
*


Posts: 2
40 / Male / Flag
Joined: Apr 2008
RE: creat window
thank,it's easy and ok with the notepad .
04-14-2008 07:20 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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