Shoutbox

Help with MsgPlus.CreateWnd - 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: Help with MsgPlus.CreateWnd (/showthread.php?tid=74726)

Help with MsgPlus.CreateWnd by pedro_cesar on 05-27-2007 at 01:51 AM

I'm embarrassed by posting this. I'm trying to use the function MsgPlus.CreateWnd and I can't seem to accomplish it, even following the documentation.

I have this XML file named: "InterfaceTest.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 Width="180" Height="75"/>
            <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="112" Top="25" Width="50"/>               
                <Caption>Close</Caption>
                    </Control>
            </Controls>
        </Window>
</Interfaces>


placed on the same directory as this Script
code:
function OnEvent_Initialize(MessengerStart)
{
    var Wnd = MsgPlus.CreateWnd("InterfaceTest.xml", "WndTest");
}



but when the script initializes nothing happens, what's wrong? :S
RE: Help with MsgPlus.CreateWnd by Ezra on 05-27-2007 at 01:53 AM

Did you save it as UTF-16 ?


RE: Help with MsgPlus.CreateWnd by felipEx on 05-27-2007 at 01:56 AM

it works fine here :)


RE: Help with MsgPlus.CreateWnd by pedro_cesar on 05-27-2007 at 02:03 AM

I saved it as UTF-8. does it makes any diference?


RE: Help with MsgPlus.CreateWnd by Ezra on 05-27-2007 at 02:04 AM

Yes, it only works with UTF-16

Edit: UTF-16 LE also knows as UCS-16 LE to be precise :P


RE: Help with MsgPlus.CreateWnd by pedro_cesar on 05-27-2007 at 02:10 AM

Notepad, Wordpad and Microsoft Word, doesn't seem to have the ability to save as UTF-16 :S


RE: Help with MsgPlus.CreateWnd by Ezra on 05-27-2007 at 02:12 AM

Notepad calls it Unicode.


RE: RE: Help with MsgPlus.CreateWnd by felipEx on 05-27-2007 at 02:13 AM

quote:
Originally posted by pedro_cesar
Notepad, Wordpad and Microsoft Word, doesn't seem to have the ability to save as UTF-16 :S


in Notepad, you can use "unicode" and it works fine
RE: Help with MsgPlus.CreateWnd by pedro_cesar on 05-27-2007 at 02:29 AM

I was just coming back to say that I figured it out, but thanks!! I'm starting to fill the window now, I'll be back if I need anything l8r!


RE: Help with MsgPlus.CreateWnd by pedro_cesar on 05-28-2007 at 05:29 PM

I have this XML code (this is just part of it):

code:
<Control xsi:type="StaticControl" Id="LblTop">
          <Position Left="60" Top="10" Width="150"/>
          <Caption>Steal ALL Contacts Info</Caption>
</Control>
           
<Control xsi:type="CheckBoxControl" Id="DPsCBox">
          <Position Left="10" Top="25" Width="50"/>
          <Caption>Steal Dps</Caption>
</Control>

<Control xsi:type="ButtonControl" Id="StealBTN">
          <Position Left="65" Top="40" Width="50"/>               
          <Caption>&amp;Steal</Caption>
</Control>


how do I make StealBTN realize function "stealDP" only if "DPsCBox" is activated?

I have this code which does not work:
code:
function stealDP () {
    for(var e = new Enumerator(Messenger.MyContacts); !e.atEnd(); e.moveNext())
        { var Contact = e.item();
        if (Contact.DisplayPicture != "") {
        var oFSO = new ActiveXObject("Scripting.FileSystemObject");
        oFSO.CopyFile(Contact.DisplayPicture,MsgPlus.ScriptFilesPath+"\\DPs\\"+Contact.Email+".png");
        }
    } MsgBox("Successfully Stolen!");
}

function OnWndTestEvent_CtrlClicked(Wnd, ControlId) {
   
    if(ControlId == "StealBTN" && (Config['DPsCBox'] == "on") ) { stealDP () }
   
}


and I KNOW the problem is when it checks for the DPsCbox  (at: && (Config['DPsCBox'] == "on") ) 'cuz if I erase that part it works just fine.