PS I just came across this example -
vb Code:
Private Declare Function SendMessageString Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long Private Const WM_SETTEXT = &HC Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Sub Form_Load() Dim lhWnd As Long lhWnd = FindWindow("Notepad", vbNullString) lhWnd = FindWindowEx(lhWnd, 0, "Edit", vbNullString) SendMessageString lhWnd, WM_SETTEXT, 0, "Hi people!" End Sub
Is there an advantage in using SendMessageString ?




Reply With Quote