You can use the following code to return a handle to the window if you know the caption, this will only work for Internet explorer windows though. If you want to find any window use vbNullString instead of the IEFrame string.
Private Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, ByVal _
lpWindowName As String) As Long
Public Function IEWindowHandle(strcaption As String) As Long
WindowHandle = FindWindow("IEFrame", strcaption)
End Function
Public Function AnyWindowHandle(strcaption As String) As Long
WindowHandle = FindWindow(vbNullString, strcaption)
End Function
hope it helps
Matt