I'm trying to control a logon screen in another app from my program. It almost works but the WM_SENDTEXT only sends the 1st character of the strings "userid" and "password" I want to send
Dim lRet As Long
Dim strText As String
Dim l_LoginWindow As Long
l_LoginWindow = FindWindow("WindowsForms10.Window.8.app.0.378734a", vbNullString)
lng_LOGON_SCREEN = l_LoginWindow
Debug.Print "Main Screen Handle"; lng_LOGON_SCREEN
retval = EnumChildWindows(lng_LOGON_SCREEN, AddressOf EnumChildProc, ByVal 0&)
strText = "userid"
Call SendMessage(lng_hLogonUserIdBox, WM_SETTEXT, 0, Asc(strText))
strText = "password"
Call SendMessage(lng_hLogonPasswordBox, WM_SETTEXT, 0, Asc(strText))
Dim lRet As Long
Dim strText As String
Dim l_LoginWindow As Long
l_LoginWindow = FindWindow("WindowsForms10.Window.8.app.0.378734a", vbNullString)
lng_LOGON_SCREEN = l_LoginWindow
Debug.Print "Main Screen Handle"; lng_LOGON_SCREEN
retval = EnumChildWindows(lng_LOGON_SCREEN, AddressOf EnumChildProc, ByVal 0&)
strText = "userid"
Call SendMessage(lng_hLogonUserIdBox, WM_SETTEXT, 0, Asc(strText))
strText = "password"
Call SendMessage(lng_hLogonPasswordBox, WM_SETTEXT, 0, Asc(strText))