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. 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]