HI
I have he textbox's hWnd, ad now i want to check if it's masked out (text written with stars)
Does anyoneknow how I can do this?
thnx
Thomas
Printable View
HI
I have he textbox's hWnd, ad now i want to check if it's masked out (text written with stars)
Does anyoneknow how I can do this?
thnx
Thomas
Check the PasswordChar property of the textbox. If it has any value other than "", then every key you press when the textbox has the focus, will be shown as the character that is the value of the PasswordChar property.
Try sending an EM_GETPASSWORDCHAR message to the textbox.
Code:Option Explicit
Private Const EM_GETPASSWORDCHAR = &HD2
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 Sub Command1_Click()
Dim retVal As Long
retVal = SendMessage(Text1.hwnd, EM_GETPASSWORDCHAR, 0&, 0&)
If retVal <> 0 Then
MsgBox "Password Character = " & Chr(retVal)
Else
MsgBox "No Password Character"
End If
End Sub