'-----------------以下代码测试通过--------------------
'以下代码放在模块文件中(.bas)
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public 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 Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Function GetDlgItem Lib "user32" (ByVal hDlg As Long, ByVal nIDDlgItem As Long) As Long
Public Declare Function CreateThread Lib "kernel32" (ByVal lpThreadAttributes As Any, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, ByVal lpParameter As Any, ByVal dwCreationFlags As Long, lpThreadID As Long) As Long
Public Const EM_SETPASSWORDCHAR = &HCC
Public g_bDone As Boolean
Public g_strTitle As String
Public Sub HookInputBoxThread()
Do Until g_bDone
Dim h As Long, hText As Long
h = FindWindow("#32770", g_strTitle)
If h <> 0 Then
hText = GetDlgItem(h, &H1324)
If hText <> 0 Then
SendMessage hText, EM_SETPASSWORDCHAR, Asc("*"), 0
g_bDone = True
End If
End If
Loop
End Sub