Hereâ€™s the code that will disable the windows X and stop users from closing the MES form from the Close button.
If you choose to use this code, you will need to end task to close the MES screen.
Private Declare Function DrawMenuBar Lib "user32.dll" (ByVal hwnd As IntPtr) As IntPtr
Private Declare Function GetSystemMenu Lib "user32.dll" (ByVal hwnd As IntPtr, ByVal bRevert As Int32) As IntPtr
Private Declare Function GetMenuItemCount Lib "user32.dll" (ByVal hMenu As IntPtr) As Int32
Private Declare Function RemoveMenu Lib "user32.dll" (ByVal hMenu As IntPtr, ByVal nPosition As Int32, ByVal wFlags As Int32) As Int32
Private Const MF_BYPOSITION As Int32 = &H400I
Private Const MF_REMOVE As Int32 = &H1000I
Private Sub MESMenu_Load(ByVal sender As object, ByVal args As EventArgs) Handles MESMenu.Load
Dim hMenu As IntPtr = GetSystemMenu(MESMenu.Handle, False)
Dim nCount As Int32 = GetMenuItemCount(hMenu)
If nCount > 2 Then
RemoveMenu(hMenu, nCount - 1, MF_REMOVE Or MF_BYPOSITION)
RemoveMenu(hMenu, nCount - 2, MF_REMOVE Or MF_BYPOSITION)
Dim EpiBtnClose as EpiButton = cType(csm.GetNativeControlReference(â€œd69f285b-eee4-48fd-a6fa-174583fdfbd9â€), EpiButton)
EpiBtnClose.Location = new System.Drawing.Point(-464, -176)
Coda-Central does not condone or encourage these activities like a Tosh.O episode.
So use this code at your own risk. Enjoy.
*Solutions for Epicor users.
"No trees were harmed during the sending of this message, however a large number of electrons were terribly inconvenienced."
From: email@example.com [mailto:firstname.lastname@example.org] On Behalf Of jgiese@...
Sent: Wednesday, September 25, 2013 2:53 PM
Subject: [Vantage] Stop MES Close
Has anyone ever been successful at stopping MES from being closed without the session killing?
[Non-text portions of this message have been removed]