Re: [api-dev] How to close the quickstarter

2006-03-08 Thread Didier Dorange-Pattoret

Hi,

Thanks fot all ... :-)

Tom Schindl a écrit :


Thanks I've added the snippet to our collection but broke it into 2
parts and linked them together.

http://codesnippets.services.openoffice.org/Office/Office.HowToCloseTheQuickstarterUnderWindows.snip
http://codesnippets.services.openoffice.org/Office/Office.HowToCloseTheQuickstarterUnderWindows2.snip

Tom
 



--
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=Contentpa=showpagepid=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

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



Re: [api-dev] How to close the quickstarter

2006-03-07 Thread Tom Schindl
Thanks I've added the snippet to our collection but broke it into 2
parts and linked them together.

http://codesnippets.services.openoffice.org/Office/Office.HowToCloseTheQuickstarterUnderWindows.snip
http://codesnippets.services.openoffice.org/Office/Office.HowToCloseTheQuickstarterUnderWindows2.snip

Tom


signature.asc
Description: OpenPGP digital signature


Re: [api-dev] How to close the quickstarter

2006-03-06 Thread Didier Dorange-Pattoret

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=Contentpa=showpagepid=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
	keywordQuickstarter/keyword
	keywordClose/keyword
	keywordWindows/keyword
	keywordAPI Windows/keyword
/keywords

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

question heading=How to close the quickstarter under Windows
pThe first way,/p
listingDeclare Function GetActiveWindow Lib quot;user32quot; () As Long
Declare Sub ExitProcess Lib quot;kernel32quot; (ByVal uExitCode As Long)

Sub Essai
   rem getting the active windowapos;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
pAnother way/p
listingSub CloseQuickstarter
	LeChemin = GetRepertoirePath(quot;progquot;)amp;quot;\quickstart.exe -killtrayquot;
	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-06Initial version/change
/changelog

/snippet

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

Re: [api-dev] How to close the quickstarter

2006-03-03 Thread Didier Dorange-Pattoret

Hi,

Mathias Bauer a écrit :


Didier Dorange-Pattoret wrote:

 


Declare Function GetActiveWindow Lib quot;user32quot; () As Long
Declare Sub ExitProcess Lib quot;kernel32quot; (ByVal uExitCode As Long)

Sub Essai
  rem getting the active windowapos;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 
   



Just to avoid confusion: of course this does not just close the
quickstarter, it shuts down the whole OOo process. That the QS is also
closed is more a collateral damage. :-)
As a side effect remote bridges or OLE connections that might be there
will be broken.
 

Thank you for your suggestions. I would be better to use the FindWindow 
function of  Win API.

But I did'nt find the  name of the quickstarter Window.



So you should better declare this snippet as something that terminates
the OOo process even if the QS is running. This will set expectations
right.
 


Tom, could you do this job.


I think we should finally provide an API to close the QS to avoid such
desperate attempts. :-)
 


Maybe, the knowledge of  the quickstarter's name should be enough.


Best regards,
Mathias

 


Didier Dorange-Pattoret.

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



Re: [api-dev] How to close the quickstarter

2006-03-03 Thread Oliver Brinzing
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

why not use

openoffice2.0\program\quickstart - killtray

to close the quickstart service ?


Oliver

- --

GnuPG key 0xCFD04A45: 8822 057F 4956 46D3 352C 1A06 4E2C AB40 CFD0 4A45
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFECE0STiyrQM/QSkURAiL9AJ0UjBPfqd2kiy48CCHx16MGx0wVxACgqCA7
Hs3RgVVWDIBfoHWf0HANPEc=
=Qjbw
-END PGP SIGNATURE-

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



Re: [api-dev] How to close the quickstarter

2006-03-03 Thread Laurent Godard

Hi Olivier



why not use

openoffice2.0\program\quickstart - killtray

to close the quickstart service ?



because it is not known :-)

Thanks a lot :-)

Laurent

--
Laurent Godard [EMAIL PROTECTED] - Ingénierie OpenOffice.org
Indesko  http://www.indesko.com
Nuxeo CPS  http://www.nuxeo.com - http://www.cps-project.org
Livre Programmation OpenOffice.org, Eyrolles 2004

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



Re: [api-dev] How to close the quickstarter

2006-03-03 Thread Tom Schindl
Done.

Tom


signature.asc
Description: OpenPGP digital signature


Re: [api-dev] How to close the quickstarter

2006-03-03 Thread Didier Dorange-Pattoret

Tom Schindl a écrit :


Done.

Tom
 


Thank you ...

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



Re: [api-dev] How to close the quickstarter

2006-03-02 Thread Mathias Bauer
Didier Dorange-Pattoret wrote:

 Declare Function GetActiveWindow Lib quot;user32quot; () As Long
 Declare Sub ExitProcess Lib quot;kernel32quot; (ByVal uExitCode As Long)
 
 Sub Essai
rem getting the active windowapos;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 

Just to avoid confusion: of course this does not just close the
quickstarter, it shuts down the whole OOo process. That the QS is also
closed is more a collateral damage. :-)
As a side effect remote bridges or OLE connections that might be there
will be broken.

So you should better declare this snippet as something that terminates
the OOo process even if the QS is running. This will set expectations
right.

I think we should finally provide an API to close the QS to avoid such
desperate attempts. :-)

Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.

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