Shoutbox

Handle of a PictureElement - 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: Handle of a PictureElement (/showthread.php?tid=80018)

Handle of a PictureElement by effection on 12-13-2007 at 06:39 PM

I'm struggling to get the handle of a PictureElement which i want to be able to hide and show in the end, but the handle always returns 0.

var Handle = ReadWindow_Wnd.GetControlHandle("imgYes");
Debug.trace("Handle: "+Handle);

"Handle: 0"

Can anyone help :)?


RE: Handle of a PictureElement by Matti on 12-13-2007 at 07:06 PM

ImageElements don't have a control handle, as they aren't controls. Plus! Live itself draws the figures and images using the Windows GDI before the controls get drawn.

However, there's a simple work-around. Create a 1 pixel by 1 pixel PNG image which is empty (i.e.: the only pixel is a fully transparent one) and name it "none.png" or something. Then, use ImageElmt_SetImageFile to set the ImageElement's image to that image. This way, it will draw nothing visible. :)


RE: Handle of a PictureElement by effection on 12-13-2007 at 07:18 PM

ah right good solution :D thanks