Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to disable warning pop-ups

Status
Not open for further replies.

Wuzhee

Automotive
Jul 12, 2022
271
[link thread560-252516]Link[/url]
Has it been resolved? Its over 13 years this thread was posted, and I haven't found an answer to it elswhere.

Few weeks ago, I was on a CATIA training and when the instructor used Save Management and checked the "Enable independent saves" box he didn't get a warning popup.
I always get these useless messages, and I'm tired of always clicking several extras because a lazy programmer didn't give us the option to disable them.
 
Replies continue below

Recommended for you


If you are coding in VB.Net you can use this. It will just close the open warning windows without disabling all file alerts. Kind of nice so you still see the important ones but can close the bulk once they build up. You can also pretty easily tweak it to work for incident reports, which are also annoying.

Code:
Private Declare Auto Function FindWindow Lib "user32.dll" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
Private Declare Auto Function FindWindowEx Lib "user32.dll" (ByVal hwndParent As IntPtr, ByVal hwndChildAfter As IntPtr, ByVal lpszClass As String, ByVal lpszWindow As String) As IntPtr
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As IntPtr) As IntPtr

Private Const BM_CLICK = &HF5

Sub closeWarnings()
        Do
            Dim warningHand As Long
            Dim Timer As Date = Now
            Do While warningHand = 0
                warningHand = FindWindow("#32770", "Warnings")
                If Now() > Timer.AddSeconds(2) Then
                    Exit Sub
                End If
                System.Threading.Thread.Sleep(50)
            Loop

            Dim closeButtonHand As Long
            Timer = Now
            Do While closeButtonHand = 0
                closeButtonHand = FindWindowEx(warningHand, Nothing, "Button", "Close")
                If Now() > Timer.AddSeconds(1) Then
                    Exit Do
                End If
                System.Threading.Thread.Sleep(50)
            Loop

            Dim valRet = SendMessage(closeButtonHand, BM_CLICK, 0, Nothing)

            warningHand = 0
            closeButtonHand = 0
            System.Threading.Thread.Sleep(50)
        Loop
    End Sub
 
I'm looking for a more generic version, like a selectable option in catsettings or somewhere else.
Not strictly of macros.
Like my example of save management warning window. I've deleted every msg box and popup from my macros, (I hate msgboxes), but the default Catia windows are annoying me every day.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor