Skip to main content
Kofax

Disabling X in SimpleAuto Station to close the application

3018531

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:

DisableWindowSystemMenu.DisableSystemMenu(csm);

9.JPG

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)

10.JPG

 

Applies to:  

Product Version
   

 

 

  • Was this article helpful?