If you know that your image is static and will never change, you're better off with adding it to your script package rather than having to download it over and over again.
- Copy your image to your script's Images directory. If the Images folder doesn't exist yet, create it. E.g.:
quote:
C:\Program Files\Messenger Plus! Live\Scripts\My Script\Images
- In your Windows XML, place the following in the <Elements> block of your window:
code:
<Element xsi:type="ImageElement" Id="ImgThing">
<Position Left="5" Top="5" Width="50" Height="50">
<Units>SizePixels</Units> <!-- This makes that you can set the width and height in pixels. You can also change this to AllPixels so everything is in pixels -->
</Position>
<Image>
<Name>Image001</Name> <!-- The file name of the image, without extension. In this case, Plus! will look for "Image001.png" in the Images folder. -->
</Image>
</Element>
- Open your window and see if it turns out right. You can change the image of the element using PlusWnd::ImageElmt_SetImageFile, as described in markee's reply to Download file.
/me looks at last post...
Crap, it isn't static at all.
Blah.
To resize a window:
code:
var Result = Interop.Call("user32.dll", "SetWindowPos", PlusWnd.Handle, 0, 0, 0, Width, Height, 18);
where:
- PlusWnd = a PlusWnd object
- Width = a number specifying the new width
- Height = a number specifying the new height
The return value "Result" will be zero (0) if the function fails, else it'll be non-zero (1).