User: Guest


Please use the
Bug Report Form
if you think you found a software defect.

Use the Contact Form
to send a personal message to Wolfgang.

RSS Feed RSS Feed

Other boards:
Raduga (English)
Song Requester

Windows handle

Posted on: SuperEdi

From Message


2005-06-28 14:26:36

Windows handle


first of all a big commendation to SuperEdi. I have integrated the program as universal Script-Editor in PowerPoint - sounds fancy, I know.

Within this integration it would be good to have the Windows handle, so that I can wait, till SuperEdi was closed...

More details: I instantiate the SuperEdi via VBA in PowerPoint:
Dim mySE as Object
Set mySE = CreateObject("SuperEdi.Application")
mySE.visible = True

Now I want to know, when SuperEdi was closed.

Can anybody help me? Thanks

Wolfgang Loch

2005-06-28 22:13:43

Re: Windows handle

Hi Gordon,

a) You could check the Application.Visible property to check if SuperEdi was closed. In this case Visible will be False.

b) SuperEdi will fire the Application_Shutdown event on shutdown. See the "Sample" add-in for an example.

c) If the above 2 options don't work for you I can add a HWND property in the next SuperEdi version.


2005-06-29 06:32:01

Re: Windows handle

Thank you for the quick answer.

(a) Works relatively good. It is not the best solution, because the SuperEdi-Object does no more exist after closing and accessing the Visible-property throws an error.

(b) Does not work, because I could not attach EventHandlers dynamically in VBA.

(c) Would be the perfect solution. By using the Windows-API function "WaitForSingleObject" I can block my current thread until SuperEdi was closed.

But now I can go on. Thanks again.

P.S.: Here is the code for solution (a):

Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sub StartSuperEdi()
Dim mySE As Object
Set mySE = CreateObject("SuperEdi.Application")
mySE.Visible = True

On Error Resume Next
Sleep 100
If Not mySE.Visible Then
Exit Do
End If
On Error GoTo 0

MsgBox "SuperEdi"
End Sub

Wolfgang Loch

2005-07-12 21:34:13

Re: Windows handle

SuperEdi 3.7.2 now has a HWND property on the Application object. Hope that helps.

Post a reply to this message: