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

Problem with Plus windows..
Author: Message:
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
27 / Male / Flag
Joined: Jul 2007
O.P. Problem with Plus windows..
Hi,

I can't get ANY Plus! window to show an image background.
Can anybody tell me what I've done wrong (this time)?

The .JS code:
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
    if(Message == "/OpenWnd") {
        var Wnd = MsgPlus.CreateWnd("Windows.xml", "WndAbt");
    }
}


The XML code:

code:
<?xml version="1.0" encoding="UTF-16"?>
<Interfaces xmlns="urn:msgplus:interface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:msgplus:interface PlusInterface.xsd">
    <Window Id="WndAbt" Version="1">
    <Attributes>
        <Caption>TestWindow</Caption>
    </Attributes>
   
        <TitleBar>
            <AllowMinimize>false</AllowMinimize>
            <Title>
                <Text>TestWindow</Text>
            </Title>
        </TitleBar>
        <Position Width="860" Height="600"/>
        <DialogTmpl/>
    </Window>
    <Elements>
        <Element xsi:type="ImageElement" Id="ImgBackgrnd">
            <Position Top="100" Left="100"/>
            <Image>
                <Name>C:\Program Files\Messenger Plus! Live\Scripts\New Message Alert\IMG\Backgrnd</Name>
                <Format>PNG</Format>
            </Image>
        </Element>
    </Elements>
</Interfaces>


This post was edited on 01-04-2008 at 06:07 PM by SmokingCookie.
01-04-2008 06:07 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
36 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Problem with Plus windows..
You cannot specify the image like that.

You have 2 options

Option 1:
Put the image in an Images directory and just put the filename between <name></name>

Option 2:
Set the image by using code that way you can specify the full path.
01-04-2008 06:11 PM
Profile E-Mail PM Find Quote Report
pollolibredegrasa
Full Member
***

Avatar
formerly fatfreechicken

Posts: 483
Reputation: 34
32 / Male / Flag
Joined: May 2005
RE: Problem with Plus windows..
quote:
Originally posted by SmokingCookie

code:
                <Name>C:\Program Files\Messenger Plus! Live\Scripts\New Message Alert\IMG\Backgrnd</Name>



If you supply a full path to the image then you need to prefix it with \.

However, if you create a folder in your script's folder called "images", and place your images in there then you don't need to supply a full path at all, you just need to put the image name ;)

bah beaten to it...

This post was edited on 01-04-2008 at 06:14 PM by pollolibredegrasa.
;p

[Image: chickennana.gif] Vaccy is my thin twin! [Image: chickennana.gif]
01-04-2008 06:14 PM
Profile PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
27 / Male / Flag
Joined: Jul 2007
O.P. RE: RE: Problem with Plus windows..
quote:
Originally posted by matty
You cannot specify the image like that.

You have 2 options

Option 1:
Put the image in an Images directory and just put the filename between <name></name>

Option 2:
Set the image by using code that way you can specify the full path.

First option didn't work.. I never knew about your 2nd option.. Could you please explane it (if possible with a clear example)? Btw, I'm a bit new to scripting..
01-04-2008 06:17 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
36 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Problem with Plus windows..
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
    if(Message == "/OpenWnd") {
        var Wnd = MsgPlus.CreateWnd("Windows.xml", "WndAbt");
        Wnd.ImageElmt_SetImageFile('ImgBackgrnd', '\\'+Messenger.ScriptFilesPath+'\\Images\\Background.png'); //i am assuming it is a png file.
    }
}
01-04-2008 06:49 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
27 / Male / Flag
Joined: Jul 2007
O.P. RE: Problem with Plus windows..
THANKS!!!!! :D
01-04-2008 06:53 PM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
29 / Male / Flag
Joined: Apr 2004
RE: Problem with Plus windows..
Although it's recommended that you just place your images in the "Images" folder, so you don't even need to call ImageElmt_SetImageFile. It would be a pain in the @$$ if you have to call that function for every image in your window, and even then, you wouldn't be able to use images in buttons, combo-box controls,...
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
01-04-2008 07:07 PM
Profile E-Mail PM Web Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
27 / Male / Flag
Joined: Jul 2007
O.P. RE: Problem with Plus windows..
Well, it's working now, so I don't care about images in buttons.. I can also use text, like "close" or "sluiten" (Dutch for "close")..

EDIT:: I've got 3 days of "vakantie" :P

EDIT2:: Can I also use this as a remote command? Like:

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Message) {
    if(Message == "!OpenWnd") {
        var Wnd = MsgPlus.CreateWnd("Windows.xml", "WndAbt");
    }
}


This post was edited on 01-04-2008 at 07:22 PM by SmokingCookie.
01-04-2008 07:13 PM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
29 / Male / Flag
Joined: Apr 2004
RE: Problem with Plus windows..
quote:
Originally posted by SmokingCookie
Can I also use this as a remote command? Like:

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Message) {
    if(Message == "!OpenWnd") {
        var Wnd = MsgPlus.CreateWnd("Windows.xml", "WndAbt");
    }
}


Sure, why not. However, I don't see the point of a remote command which opens a window. :P
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
01-04-2008 07:58 PM
Profile E-Mail PM Web Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
27 / Male / Flag
Joined: Jul 2007
O.P. RE: Problem with Plus windows..
'Coz I'm thinkong of doing it in future scripts :P

Merci, et bonne fin des vacanses :P
(sorry, that's what little French I speak.. Have lessons at school :D )

This post was edited on 01-04-2008 at 08:04 PM by SmokingCookie.
01-04-2008 08:03 PM
Profile 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