View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike[_111_] Mike[_111_] is offline
external usenet poster
 
Posts: 27
Default Waiting for an external app to finish

I am using XL2003 on WinXP

I have a piece of code I call waiting for me to close down my email
client which I call from excel (it's not outlook so I can't do any fancy
object stuff) - basically I am doing a goto URL with a mailto link
prepared


Anyway this is the code I am using

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Function IsRunning(psTaskName As String) As Boolean

If FindWindow(vbNullString, psTaskName) < 0 Then
IsRunning = True
End If

End Function

Last time I know this was working was in August this year. Maybe a
WinXP update has changed the behaviour of the libraries? My program is
just looping round, even though I know the program isn't on the task
list,

Is there another way of doing this, and/or is there also a way of
listing all the windows running so I can at least try and work out what
the problem is please?
--
Mike News