Hello;
Suppose I have a text box in a form not in my Project and it has a password char and I know it's handle. how to get the password behind the mask! (using API)
I had tried the EM_GETLINE message but I got a critical error, why?
Printable View
Hello;
Suppose I have a text box in a form not in my Project and it has a password char and I know it's handle. how to get the password behind the mask! (using API)
I had tried the EM_GETLINE message but I got a critical error, why?
Use the GetwindowText function.
Code:Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Sub Command1_Click()
Dim sText As String * 255
Dim iLength As Integer
iLength = GetWindowText(MyTextBox.hWnd, sText, 255)
'Trim the string
sText = Left(sText, iLength)
MsgBox sText
End Sub