In converting this VB6 program to VB.net I stumbled across this
and saw Left is not a member of VBA. in error . now VBA should have a member that handles string types right ?
Code:
Public Function FindParentWindow(ByVal TitleStart As String) As Long
Dim hWndTmp
Dim nRet
Dim TitleTmp As String
hWndTmp = FindWindow(vbNullString, vbNullString)
Do Until hWndTmp = 0
If GetParent(hWndTmp) = 0 Then
TitleTmp = Space(256)
nRet = GetWindowText(hWndTmp, TitleTmp, Len(TitleTmp))
If nRet Then
TitleTmp = UCase(VBA.Left(TitleTmp, nRet))
If InStr(TitleTmp, UCase(TitleStart)) Then
FindParentWindow = hWndTmp
Exit Do
End If
End If
End If
hWndTmp = GetWindow(hWndTmp, GW_HWNDNEXT)
Loop
End Function