|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to decrypt password asterisks
Hello, I need help. I am developing a piece of software which, among other things, should contain a function which allows you to decrypt the asterisks used to hide passwords. It should be able to unmask all the passwords visible on the screen.
In order to get this, I placed the following code in a module: '---START OF VB CODE--- Option Explicit Public Declare Function EnumChildWindows Lib "User32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long Public Declare Function EnumWindows Lib "User32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long Public Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long Public Declare Function ShowWindow Lib "User32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Public Const EM_GETPASSWORDCHAR = &HD2 Public Const EM_SETPASSWORDCHAR = &HCC Public Const EM_SETMODIFY = &HB9 Public Const SW_HIDE = 0 Public Const SW_SHOW = 5 Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Long EnumChildWindows hwnd, AddressOf EnumWindowsProc2, 1 EnumWindowsProc = True End Function Public Function EnumWindowsProc2(ByVal hwnd As Long, ByVal lParam As Long) As Long If SendMessage(hwnd, EM_GETPASSWORDCHAR, 0, 1) Then UpdateWindow hwnd End If EnumWindowsProc2 = True End Function Public Sub UpdateWindow(hwnd As Long) SendMessage hwnd, EM_SETPASSWORDCHAR, 0, 1 SendMessage hwnd, EM_SETMODIFY, True, 1 ShowWindow hwnd, SW_HIDE ShowWindow hwnd, SW_SHOW End Sub Public Function UnmaskPasswords() EnumWindows AddressOf EnumWindowsProc, 1 End Function '---END OF VB CODE--- This function seems to work perfectly when used under Windows 95, 98 and Me. To unmask all the asterisks on the screen, just call UnmaskPasswords. The problem arises when you run the software containing the function above under Windows XP, where the characters used to conceal the passwords are not asterisks but round-shaped bullets. In that case, calling the UnmaskPasswords function produces no results. Does anybody know how to make the code work with both the asterisks and the bullets? Thanks in advance. Pasquale Esposito Perugia, Italy http://www.toprete.com/software |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > How to decrypt password asterisks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|