PDA

Click to See Complete Forum and Search --> : Text Boxes!


Mine_23
Feb 10th, 2001, 02:42 PM
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?

Feb 10th, 2001, 04:40 PM
Use the GetwindowText function.

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