Hi,
Mathias Bauer a écrit :
Didier Dorange-Pattoret wrote:
Declare Function GetActiveWindow Lib "user32" () As Long
Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)
Sub Essai
rem getting the active window'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, "[EMAIL PROTECTED]
com.sun.star.util.XCloseable}") 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]