I've got the following code. It works fine at win 98 but it gives an error ("invalid function call or argument") somewhere in this piece of code (I think).
can anybody help me??

bWnd = GetWindow(tWnd, GW_CHILD)
List1.AddItem Time$ + " Searching for Passwordbox..."
Print #1, Time$ + " Searching for Passwordbox..."
StartTime = Time
Do
Label1.Caption = "Searching for Passwordbox " + Format$(Time - StartTime, "hh:mm:ss")
sSave = Space(250)
GetClassName bWnd, sSave, 250
sSave = Left$(sSave, Len(RTrim(sSave)) - 1)

If (LCase(sSave) = LCase(Combo1.Text)) Then
lngLen = SendMessage(bWnd, WM_GETTEXTLENGTH, 0, 0)
str = Space(lngLen)
Call SendMessage(bWnd, WM_GETTEXT, lngLen, ByVal str)
If (str = "") Then
Exit Do
End If
End If
If (bWnd = 0) Then
bWnd = GetWindow(tWnd, GW_CHILD)
Else
bWnd = GetWindow(bWnd, GW_HWNDNEXT)
End If
DoEvents: DoEvents: DoEvents
Loop Until (DoLock = False) Or (FormLoaded(tWnd) = False)
If (DoLock = False) Then GoTo Abort
List1.AddItem Time$ + " Passwordbox Found (" + Hex$(bWnd) + ")"
Label1.Caption = "Unable to lock"
Loop Until bWnd <> 0