When
an add-in displays a dialog box, the add-in needs to keep the dialog box in
front of whatever window launched it. Failure to do so may result
in the dialog box disappearing and the user
becoming confused.
C++
To keep the dialog box in the foreground, you can
specify a
parent window handle when the new dialog box is created.
VB.NET or C#
Window handling is supported in all versions of
SolidWorks PDMWorks
Enterprise and in SolidWorks Enterprise PDM 6.4 and later. In SolidWorks Enterprise PDM 6.4 only, you must also enable the
Multithreaded Add-ins Threading policy.
Unlike Visual Basic 6, VB.NET and C# allow you to create add-in modules that support
multi-threading. When
SolidWorks
Enterprise PDM runs a multi-threaded NET add-in, it executes it in the same thread
as the parent window. Calls to
IEdmVault5::SetAddInWnd,
which were previously recommended for Visual Basic 6, are no longer necessary.
To keep an add-in window in the foreground, call
IEdmVault8::GetWin32Window
in the .NET form of your add-in to specify the handle of the parent window.