Move main window at startup - SOLVED

Hi,

I have created an HEScript within EXEoutput to move the window location at startup.

My HEScript is called SetUIProp in the scripting section and includes the following:
procedure ResizeOnLoad;
begin
SetUIProp(“fview”,“Width”,“150”);
SetUIProp(“fview”,“Height”,“50”);
SetUIProp(“fview”,“Top”,“0”);
SetUIProp(“fview”,“Left”,“800”);
end

In my index php file I have included the call

<?php echo exo_return_hescriptcom("SetUIProp.ResizeOnLoad", "Error"); ?>

When the application loads it is positioned in the correct area of the screen according to the dimensions above but I have nothing displayed within it other than the following:
“Fatal Error: Could not convert variant of type (Null) into type (OleStr). Please reload the page.”

What have I done wrong?

I think you should better update the UI at startup through HEScript user script rather than PHP.
In PHP, edit the UserMain script and modify the event:

procedure OnStartMainWindow;
begin
SetUIProp("fview","Width","150"); 
SetUIProp("fview","Height","50");
SetUIProp("fview","Top","0"); 
SetUIProp("fview","Left","800");
end;
1 Like

That works. Many thanks!