Option Explicit
Private Const ES_PASSWORD = &H20&
Private Const GWL_STYLE& = (-16)
Private Declare Function GetWindowLong Lib _
"user32" Alias "GetWindowLongA" (ByVal hwnd _
As Long, ByVal nIndex As Long) As Long
Private Function CheckPassStyle(thwnd As Long) As Boolean
Dim tStyle As Long
tStyle = GetWindowLong(thwnd, GWL_STYLE)
CheckPassStyle = tStyle And ES_PASSWORD
End Function
Private Sub Form_Load()
MsgBox CheckPassStyle(Text1.hwnd)
End Sub