Skip to main content

Disabling X in SimpleAuto Station to close the application

Article # 3018531 - Page views: 185


Question / Problem: 

We are seeing a rare behavior in SimpleAuto stations, when the operator clicks the “X” in the upper right corner of the GUI the efSimpleAuto.exe hangs and remains running as an orphan. If the operator choose the option “File” and then “Exit”, the efSimpleAuto.exe close normally.

So, any way on to disable this option to close the application using the “X”?

Answer / Solution: 

Paste the class below anywhere in your code, in the OnLogin event of the stations to disable the close button call the following:



This is how the simple auto station window will look (in this case with no application name as ApplicationId command parameter was not specified).

using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using TiS.Core.eFlowAPI;

namespace YOUR_Namespace { #region "DisableWindowSystemMenu" class public class DisableWindowSystemMenu { #region Windows API calls [DllImport("user32.dll", EntryPoint = "FindWindow")] private static extern IntPtr FindWindow(string sClass, string sWindow)



Applies to:  

Product Version



  • Was this article helpful?