Files
pdm/documentation/api_extracted/KeepWindowInfront.htm

62 lines
2.4 KiB
HTML

<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<title>Keeping Add-in Windows in the Foreground</title>
<meta name=MS-HKWD content="Add-ins, dialog boxes">
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="stylesheet" type="text/css" href="ApiHelp.css">
</head>
<h1><span style="font-weight: normal; font-size: 7.5pt;">SOLIDWORKS PDM Professional API Help</span></h1>
<h1>Keeping Add-in Windows in the Foreground</h1>
<body bgcolor=white lang=SV link=blue vlink=purple style='tab-interval:65.2pt'>
<div class=Section1>
<body bgcolor=white lang=SV link=blue vlink=purple style='tab-interval:65.2pt'>
</body>
<p><span lang=EN-US>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. </span></p>
<h2><span lang="en-us">C++</span></h2>
<p><span lang=EN-US>To keep the dialog box in the foreground, you can
specify a
parent window handle when the new dialog box is created.</span></p>
<h2><b style='mso-bidi-font-weight:normal'><span lang=EN-US>VB.NET or C#</span></b></h2>
<p><span lang="en-us">W</span><span
lang=EN-US>indow handling is supported in
<span class=SpellE>SOLIDWORKS PDM Professional</span> 6.4 and later. In <span
class=SpellE>SOLIDWORKS PDM Professional</span> 6.4 only, you must also enable the
Multithreaded Add-ins Threading policy.&nbsp;</span></p>
<p><span lang="en-us">Unlike Visual Basic 6, </span><span
lang=EN-US>VB.NET and C# allow you to create add-in modules that support
multi-threading. When <span class="SpellE">
SOLIDWORKS</span>
PDM Professional runs a multi-threaded NET add-in, it executes it in the same thread
as the parent window. Calls to <span
class=SpellE>
<a href="EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmVault5~SetAddInWnd.html">IEdmVault5::SetAddInWnd</a></span>,
which were previously recommended for Visual Basic 6, are no longer necessary.</span></p>
<p><span
lang=EN-US>To keep an add-in window in the foreground, call
<a href="EPDM.Interop.epdm~EPDM.Interop.epdm.IEdmVault8~GetWin32Window.html">IEdmVault8::GetWin32Window</a>
in the .NET form of your add-in to specify the handle of the parent window. </span></p>
</div>
</body>
</html>