بدلا من الأول
وضع الكود الآتي في وحدة نمطية جديدة أو أسفل الكود السابق
Option Compare Database
Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
'++++++++++++++++
Declare Function SetTimer Lib "user32" (ByVal hwnd _
As Long, ByVal nIDEvent As Long, ByVal uElapse _
As Long, ByVal lpTimerFunc As Long) As Long
Declare Function KillTimer Lib "user32" _
(ByVal hwnd As Long, ByVal nIDEvent As Long) _
As Long
Declare Function FindWindowEx Lib "user32" _
Alias "FindWindowExA" (ByVal hWndParent As _
Long, ByVal hWndChildAfter As Long, ByVal _
lpClassName As String, ByVal lpWindowName _
As String) As Long
Declare Function Sendmessagebynum _
Lib "user32" Alias "SendMessageA" (ByVal _
hwnd As Long, ByVal wMsg As Long, ByVal _
wParam As Long, ByVal lParam As Long) _
As Long
Const EM_SETPASSWORDCHAR = &HCC
Public str_Title$, TimerId&
Sub TimerProc(ByVal hwnd As Long, ByVal uMsg As Long, _
ByVal uElapse As Long, ByVal lpTimerFunc As Long)
KillTimer 0, TimerId
Dim lng_Hwnd&
lng_Hwnd = FindWindowEx(0, 0, "#32770", _
Trim(str_Title))
lng_Hwnd = FindWindowEx(lng_Hwnd, 0, _
"Edit", vbNullString)
If lng_Hwnd Then
Sendmessagebynum lng_Hwnd, EM_SETPASSWORDCHAR, 42, 0
End If
End Sub