Starting app with a hidden window

I’m trying to start the app in a “hidden” state. I’m using this to run some code when the app is installed or uninstalled. In version 1.6, I would do this by calling from PHP:

exo_runhescriptcom(“MainScript.hideWindow”);

and having a HEScript procedure that looks like this:

procedure hideWindow;
begin
SetUIProp(“fview”, “Top”, “-1000” );
SetUIProp(“fview”, “Left”, “-1000” );
SetUIProp(“fview”,“Visible”,“False”);
SetUIProp(“spTrayIcon1”, “IconVisible”, “False”);
end;

In the 2020 version, this no longer works. The app starts and the window remains visible. Is there any way I can run the app in “client” mode – either move the window outside the visible area, or hide it, or not using a window at all? I would include a separate exe file for this, built as a “client application”, but the generated exe files are huge and I would not want to double the size of my installer.

Thanks!

Maybe you still have the following options in your old project?
image

Here are the settings from 1.6 vs 2020.

It seems that PHP code no longer has access to the app window via HEScript. For instance, in the old version (v1.6) I was able to call from PHP:

exo_runhescriptcom(“Macros.MacroExit”);

and have in MainScript:

procedure MacroExit;
begin
ExitPublication;
end;

and the app would exit. In the new version (2020), this no longer works. Instead, I have to call from JavaScript code in the page:

exeoutput.RunHEScriptCode(“ExitPublication;”);

and that works. So calling HEScript from PHP to exit the app has no effect, while calling the same HEScript from Javascript does the job.

Maybe it’s the same problem with calling the HEScript in order to hide the window? That it cannot be called from PHP, but only from Javascript? Unfortunately, in this particular case, calling HEScript from Javascript would not be an option, because Javascript is only executed once the window is fully loaded.

Since “Always center the window” is ticked, it makes sense why your code to move the window to a hidden position does not work. Try to untick that option and tick “allow end users to resize the window”.

It’s because ExeOutput 2020 is based on different processes. PHP should not be used to modify the UI anymore since the PHP engine and the UI engine are in different processes. You should either use HEScript or JavaScript.