User Tools

Site Tools


Sidebar



en:objects:app:visible_params:minimize_to_tray_by_start

minimize_to_tray_by_start

minimize_to_tray_by_start($minimize=true); - controls the app's minimization setting in the tray at startup (available from version 6.0.39)

the input Function accepts parameters:

  • $minimize – flag to minimize the app to the tray at startup, if true - minimize, and if false - open as usual

    After testing, the function returns the result of its work to the script :
  • true – successful
  • false – operation failed

    PHP example:

    <?php $xhe_host = "127.0.0.1:7020";
     
    //connect the object to control the emulator, if not already connected
    if(!isset($path))
       $path = "../../../Templates/xweb_human_emulator.php";
    require($path);
     
    //Start
    echo "<hr> <font color = blue> app->".basename(__FILE__)."</font> <hr>";
     
    //depending on the state
    if(count($argv) == 1)
    {
    //1
    echo "1.Minimize to tray with stratum:";
    echo $app->minimize_to_tray_by_start(true)."<br>";
    sleep(1);
     
    //2
    echo "2.Restart:";
    echo $app->restart(__ FILE __, "2 2");
    }
    else
    {
    //1
    echo "1.Do not minimize to tray when stratum:";
    echo $app->minimize_to_tray_by_start(false)."<br>";
    }
     
    //end
    echo "<hr> <br>";
     
    //Quit
    $app->quit();
    ?>

    Python example:

    # Additional paths
    import sys
    sys.path.insert(0, '../../../Templates PY/')
     
    xhe_host = "127.0.0.1:7020"
    from xweb_human_emulator import *
     
    # Start
    echo("<hr> <font color = blue> app.minimize_to_tray_by_start </font> <hr>")
     
    # depending on the state
    if len(sys.argv) == 1:
    # 1
    echo("1.Minimize to tray on strat:");
    echo(app.minimize_to_tray_by_start(True), "<br>");
    sleep(1);
    # 2
    echo("2.Restart:");
    echo(app.restart(debug.get_cur_script_path(), "2 2"));
    else:
    # 1
    echo("1.Do not minimize to tray when strutting:");
    echo(app.minimize_to_tray_by_start(False), "<br>");
     
    # end
    echo("<hr> <br>")
     
    # Quit
    app.quit()

    C# example:

    #region using
     
    using System;
    using System.Diagnostics;
    using System.Collections.Generic;
    using System.Linq;
    using System.IO;
    using System.Text;
    using System.Threading;
     
    using XHE;
    using XHE.XHE_DOM;
    using XHE.XHE_System;
    using XHE.XHE_Window;
    using XHE.XHE_Web;
     
    #endregion
     
     class Program: XHEScript
     {
    static void Main(string [] args)
    {
    //init XHE
    server = "127.0.0.1:7022";
    InitXHE();
     
    //Start
    echo("<hr> <font color = blue> app.minimize_to_tray </font> <hr>");
     
               //depending on the state
                if(args.Length == 0)
                {
                   //1
                    echo("1.Minimize to tray on strat:");
                    echo(app.minimize_to_tray_by_start(true) + "<br>");
                    sleep(3);
     
                   //2
                    echo("2.Restart:");
                    echo(app.restart(debug.get_cur_script_path(), "2 2"));
                }
                else
                {
                   //1
                    echo("1.Do not minimize to tray when stratum:");
                    echo(app.minimize_to_tray_by_start(false) + "<br>");
                }
     
    //end
    echo("<hr> <br>");
     
    app.quit();
    }
    }

    Java Script example:

    //connect the object to control the emulator, if not already connected
    xhe_host = "127.0.0.1:7020";
    echo = require("../../../Templates JS/xweb_human_emulator.js");
     
    //Start
    echo("<hr> <font color = blue> app.minimize_to_tray </font> <hr>");
     
    //command line arguments
    var argv = process.argv;
     
    //depending on the state
    if(argv.length == 2)
    {
    //1
    echo("1.Minimize to tray on strat:");
    echo(app.minimize_to_tray_by_start(true) + "<br>");
    app.sleep(1);
     
    //2
    echo("2.Restart:");
    echo(app.restart(debug.get_cur_script_path(), "2 2"));
    }
    else
    {
    //1
    echo("1.Do not minimize to tray when stratum:");
    echo(app.minimize_to_tray_by_start(false) + "<br>");
    }
     
    //end
    echo("<hr> <br>");
     
    //Quit
    app.quit();
  • en/objects/app/visible_params/minimize_to_tray_by_start.txt · Last modified: 2026/08/05 22:31 (external edit)