First, I was wrong about SetWindowPos();. My apologies. You actually need to use MoveWindow();
Second, you've probably got the first part correct, but the second is kinda.. ya know..
As the scripting docs say, you need to pass the element ID to PlusWnd::GetElementPos(). (It's actually PlusWnd.GetElementPos(ElementID,Type)). So this is what you'll need to do with your PlusWnd:
JScript code:
function RetrievePos(PlusWnd,ElementID) {
var PosInfo = new Object();
PosInfo.X = PlusWnd.GetElementPos(ElementID,POSINFO_X /* Predefined within MPL itself */);
PosInfo.Y = PlusWnd.GetElementPos(ElementID,POSINFO_Y);
PosInfo.Width = PlusWnd.GetElementPos(ElementID,POSINFO_WIDTH);
PosInfo.Height = PlusWnd.GetElementPos(ElementID,POSINFO_HEIGHT);
return PosInfo;
}
Call this function with the parent window object (WndCommandBar_Shell) and the element ID specified in your interface XML.
For MoveWindow(), you need to pass the handle to your child window (WndCommandBar_CMain), its coordinates and size (the information stored in the object returned by my RetrievePos() function) and whether it should be redrawn or not. So it's MoveWindow(hWnd,x,y,width,height,redraw);. Once again, this function is located in User32.dll.
BTW, I recommend redrawing the window through MoveWindow();