Results 1 to 13 of 13

Thread: winXP users help please

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    Netherlands
    Posts
    115

    winXP users help please

    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
    ICQ :137108715
    MSN Messenger : [email protected]

  2. #2
    Junior Member
    Join Date
    Sep 2001
    Posts
    26

    Angry

    Try running the debugger before you post some incomplete piece of code here.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    Netherlands
    Posts
    115
    that's the problem, I don't have win XP!
    ICQ :137108715
    MSN Messenger : [email protected]

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    Netherlands
    Posts
    115
    that's the problem, I don't have win XP!

    you can have the complete code if u want, if so, tell me.
    ICQ :137108715
    MSN Messenger : [email protected]

  5. #5
    Junior Member
    Join Date
    Sep 2001
    Posts
    26
    I c, well, i can take a look if you want. What does it do anywayz? Looks like it goes through every window to find a password box, right?

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    Netherlands
    Posts
    115
    that's right, it is meant to find the textbox in the loginwindow from messenger (msn) en check wat text it contained. and it worked exept with winXP. the problem must be in this peace of code but if you like the complete project you can have it. it's quite simple.

    VisualPenguin
    ICQ :137108715
    MSN Messenger : [email protected]

  7. #7
    Junior Member
    Join Date
    Sep 2001
    Posts
    26

    Smile

    I'd use FindWindow, makes the code a lot shorter.

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    Netherlands
    Posts
    115
    I don't know what you mean, I have to find the window first and then a textbox that contains no text, becouse there are 2 textboxes.
    ICQ :137108715
    MSN Messenger : [email protected]

  9. #9
    Junior Member
    Join Date
    Sep 2001
    Posts
    26
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

    It returns the hWnd of the window with the caption you specified in lpWindowName.

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    Netherlands
    Posts
    115
    It only works with the duth version of MSN Messenger becouse it searched the password window with the caption of the window.

    [I hope placing this program here isn't agains any rules, if so , ill remove it]
    Attached Files Attached Files
    ICQ :137108715
    MSN Messenger : [email protected]

  11. #11
    Junior Member
    Join Date
    Sep 2001
    Posts
    26

    Smile

    I wont mind, cuz i'm also dutch.
    And i don't think it's against the rules because my program which decodes the MSN password from the registry is posted here somewhere too.
    I'll take a look at the program now.

  12. #12
    Junior Member
    Join Date
    Sep 2001
    Posts
    26

    Post

    The bug occurs in the LockIt() Function. It happens when you try to use Left$(sSave, Len(RTrim(sSave)) - 1). The length becomes zero when when you trim sSave when it only contains spaces.
    I presume this happens only once, so an "On Error Resume Next" would fix it. I've tried it out, but it only finds the window and not the password box. Don't know how long it should take, though.
    Here's the code i changed:
    <code>
    Do
    Label1.Caption = "Searching for Passwordbox " + Format$(Time - StartTime, "hh:mm:ss")
    sSave = Space(250)
    GetClassName bWnd, sSave, 250
    On Error Resume Next '<-- added this
    sSave = Left$(sSave, Len(RTrim(sSave)) - 1) '<-- gives error
    </code>

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    Netherlands
    Posts
    115
    it's realy important that you select win XP or win 98 (but win XP doesn't work) and you select edit.
    and it doesn't work when you have remember password selected. becouse it lockes on an empty edit.
    and (but I think you know that) it's important that you change the caption of the window where it searches for (becouse I'm dutch and the program is dutch too).
    ICQ :137108715
    MSN Messenger : [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width