Hello,
you can use the BeforeProjectChanged() event, unlike the name suggest it also triggers when closing a project.
It does not trigger when closing Dxdesigner so for for that you also need to use the shutdown() event.
Example in vbscript:
Scripting.AddTypeLibrary("ViewDraw.Application")
Dim VdApp : Set VdApp = Application
Call Scripting.AttachEvents(VdApp, "VdApp")
Scripting.DontExit = True
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub VdApp_Shutdown()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if Len(vdapp.GetProjectData().GetProjectPath) <> 0 then 'also triggers on opening a design
msgbox "Shutdown" & vbnewline & "Active Design:" & vdapp.GetProjectData().GetProjectPath & "(" & vdapp.GetActiveDesign() & ")"
end if
End sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub VdApp_BeforeProjectChanged()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if Len(vdapp.GetProjectData().GetProjectPath) <> 0 then 'also triggers on opening a design
msgbox "Before project is closed" & vbnewline & "Active Design:" & vdapp.GetProjectData().GetProjectPath & "(" & vdapp.GetActiveDesign() & ")"
end if
End sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''