Click or drag to resize

RuntimeManagerHmiScreenHandle Property

Gets or set a windows handle (HWND) to display custom screens of the HMI extension.

Namespace:  OpenTestSystem.Otx.Runtime.Api
Assembly:  OpenTestSystem.Otx.Runtime.Api (in OpenTestSystem.Otx.Runtime.Api.dll) Version: 5.5.0.0 (6.1.0.31040)
Syntax
public long HmiScreenHandle { get; set; }

Property Value

Type: Int64

Implements

IRuntimeManagerHmiScreenHandle
Remarks

OTX customs screens of HMI extension handled by the OTX runtime can be integrated into users application. If the user set the value of HmiScreenHandle to a handle (HWND) of a window or panel, the screen will be drawn inside this window or panel. If the user set the value of this property to zero (0), the OTX screen is closed inside the OTX runtime environment.

Important note Important
Please note, that the window shall exists, while HmiScreenHandle has a handle differnt from zero. Otherwise the OTX runtime can be thrown an uncatchable exception, which can crash the whole application! The value of HmiScreenHandle shall be set to zero before the container windows is closed, e.g. in the System.Windows.Forms.FormClosing event, see example below.
Important note Important
Please note, that the value of the property have to be set before a procedure is executed, otherwise the value has no effect.
Examples
Simple exsample which handles the OTX customs screens.
C#
private void DisplayCustomScreenForm()
{
    System.Windows.Forms.Form form = new System.Windows.Forms.Form();
    form.FormClosing += new System.Windows.Forms.FormClosingEventHandler(form_FormClosing);
    form.Show();

    if (rtManager != null)
    {
        rtManager.HmiScreenHandle = form.Handle;
    }
}

void form_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
{
    if (rtManager != null)
    {
        rtManager.HmiScreenHandle = 0;
    }
}
See Also