Hello Tom,

How to close OOo and/or the quickstarter but with two ways.

Thanks to Oliver Brinzing.

--
Didier Dorange-Pattoret

http://www.dmaths.org
http://sesamath.net

S'inscrire à la liste de diffusion de dmaths: [EMAIL PROTECTED]
Ses archives: http://listes.dmaths.org/wws/arc/users
Les Forums: http://www.dmaths.org/modules.php?name=Forums
Mailing List in english: 
http://www.dmaths.org/modules.php?name=Content&pa=showpage&pid=9

Le livre de référence pour OpenOffice.org2 : 
http://www.amazon.fr/exec/obidos/ASIN/2212116381/dmaths-21
Programmation OpenOffice.org2 : 
http://www.amazon.fr/exec/obidos/ASIN/2212117639/dmaths-21

<?xml version="1.0"?>
<!--
$RCSfile: $
last change: $Revision: $ $Author: $ $Date: $

(c)2003 by the copyright holders listed with the author-tags.
If no explicit copyright holder is mentioned with a certain author,
the author him-/herself is the copyright holder. All rights reserved.

Public Documentation License Notice:

The contents of this Documentation are subject to the
Public Documentation License Version 1.0 (the "License");
you may only use this Documentation if you comply with
the terms of this License. A copy of the License is
available at http://www.openoffice.org/licenses/PDL.html

The Original Documentation can be found in the CVS archives
of openoffice.org at the place specified by RCSfile: in this header.

The Initial Writer(s) of the Original Documentation are listed
with the author-tags below.

The Contributor(s) are listed with the author-tags below
without the marker for being an initial author.

All Rights Reserved.
-->

<snippet language="OOBasic" application="Office">

<keywords>
	<keyword>Quickstarter</keyword>
	<keyword>Close</keyword>
	<keyword>Windows</keyword>
	<keyword>API Windows</keyword>
</keywords>

<authors>
	<author id="ddorange" initial="true" email="[EMAIL PROTECTED]" copyright="Didier Dorange-Pattoret">Didier Dorange-Pattoret</author>
</authors>

<question heading="How to close the quickstarter under Windows">
<p>The first way,</p>
<listing>Declare Function GetActiveWindow Lib &quot;user32&quot; () As Long
Declare Sub ExitProcess Lib &quot;kernel32&quot; (ByVal uExitCode As Long)

Sub Essai
   rem getting the active window&apos;s handle.
   hWnd = GetActiveWindow()
   rem closing all active windows
   On error resume Next
       myEnum = StarDesktop.Components.CreateEnumeration
       Do while myEnum.HasmoreElements
           oDoc = myEnum.NextElement
           If HasUnoInterfaces(oDoc, &quot;[EMAIL PROTECTED] com.sun.star.util.XCloseable}&quot;) Then
           oDoc.close(true)
           Else
           oDoc.dispose()
           End If
       Loop
       On error goto 0
   rem closing the quickstarter
   ExitProcess(hWnd)
End Sub </listing>
</question>

<answer>
<p>Another way</p>
<listing>Sub CloseQuickstarter
	LeChemin = GetRepertoirePath(&quot;prog&quot;)&amp;&quot;\quickstart.exe -killtray&quot;
	Shell(LeChemin)
End Sub

Function GetRepertoirePath(sInstPath as String) as String &apos;donne le r&#233;pertoire correspondant
Dim  oPathSubstSrv as Object
Dim sPath as String
	sInstPath = &quot;$(&quot;+sInstPath+&quot;)&quot;
  oPathSubstSrv = createUnoService(&quot;[EMAIL PROTECTED] com.sun.star.comp.framework.PathSubstitution}&quot;)
  sPath = ConvertFromUrl(oPathSubstSrv.getSubstituteVariableValue(sInstPath))
	GetRepertoirePath = sPath
End Function</listing>
</answer>

<versions>
	<version number="2.0.x" status="tested"/>
</versions>

<operating-systems>
<operating-system name="Win32"/>
</operating-systems>

<changelog>
	<change author-id="ddorange" date="2006-03-06">Initial version</change>
</changelog>

</snippet>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to