I am trying to work with the API Sendmessage, and its possible messages. My little project is to change
my hotmail account name in the textbox of the hotmail sign in page.( I know of allapi, and I have a spying program
to look at childs of windows,etc.

So far I have this, but it is not having any effect. I suspose from reading other threads I need to find a handle to the
particular textbox to add data.
I am using VB.NET
VB Code:
  1. Public Class Form1
  2.  
  3.     Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( ByVal lpClassName As String,ByVal lpWindowName As String) As Int32
  4.     Private Declare Function GetWindow Lib "user32.dll" (ByVal hwnd As Int32, ByVal wCmd As Int32) As Int32
  5.  
  6.     Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Int32, ByVal hWnd2 As Int32, ByVal lpsz1 As String, ByVal lpsz2 As String) As Int32
  7.  
  8.     Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32
  9.     Private Const WM_LBUTTONDOWN As Int32 = &H201
  10.     Private Const GW_CHILD As Int32 = 5
  11.  
  12.     Private Const WM_SETTEXT As Int32 = &HC
  13.  
  14.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  15.         Dim title As String = "Sign In - Microsoft Internet Explorer"
  16.         Dim winclass As String = "IEFrame"
  17.         'login page
  18.         Dim winchildclass As String = "Internet Explorer_Server"
  19.         'found by spying on login page of hotmail seems to be the child
  20.         Dim handlemain As Int32
  21.        
  22.  
  23.         handlemain = FindWindow(winclass, title)
  24.             Dim hwndtextbox As Int32
  25.             hwndtextbox = FindWindow(winchildclass, vbNullString)
  26.             Dim han As Int32
  27.                      '     hwndtextbox = FindWindowEx(handlemain, 0&, [TextboxClassName], vbNullString)
  28.             '   dog = GetWindow(handlemain, GW_CHILD)
  29.  
  30.             Dim cat As String = "hello there"
  31.  
  32.             SendMessage(han, WM_SETTEXT, Len(cat), cat)  
  33.     End Sub
  34. End Class