 | OO-Snippets: How to Terminate the OOo process even if the QS is runningCommons| Keywords | Quickstarter, Close, Windows, API Windows |
|---|
| Language | OOBasic |
|---|
| Application | Office |
|---|
| Authors | Didier Dorange-Pattoret (initial)
|
|---|
| Supported Versions | 2.0.x |
|---|
| Supported OS | Win32 |
|---|
| Question | Is there another way to terminate the OOo process even if the QS is running beside Office.HowToCloseTheQuickstarterUnderWindows2.snip
|
|---|
| Answer | |
|---|
Declare Function GetActiveWindow Lib "user32" () As Long
Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)
Sub Essai
hWnd = GetActiveWindow()
On error resume Next
myEnum = StarDesktop.Components.CreateEnumeration
Do while myEnum.HasmoreElements
oDoc = myEnum.NextElement
If HasUnoInterfaces(oDoc, "com.sun.star.util.XCloseable") Then
oDoc.close(true)
Else
oDoc.dispose()
End If
Loop
On error goto 0
ExitProcess(hWnd)
End Sub
|
|