Ok,
a piece of code...
This is the function I use for looping over the child windows in IE.
Everything works well except the SendMessageA function
Public Function EnumChildWindowsSub(ByVal argl_hChildWnd As IntPtr, ByVal
argl_Param As Integer) As Boolean
Dim lsb_ClassName As New StringBuilder(256)
Call GetClassNameA(argl_hChildWnd, lsb_ClassName,
lsb_ClassName.Capacity)
If (lsb_ClassName.ToString = "ComboBox") Then
SendMessageA(argl_hChildWnd.ToInt32, CB_INSERTSTRING, 0,
"
www.thatsite.com")
'This just for see with Spy that the combo handle is correct
Me.Text = "I find combo with handle " &
Hex(argl_hChildWnd.ToInt32).ToString
Return False
Else
Return True
End If
End Function
And this is the prototype for the function.
Private Declare Auto Function SendMessageA Lib "user32" (ByVal hwnd As Long,
ByVal wMsg As Long, ByVal wParam As Long, <MarshalAs(UnmanagedType.LPStr)>
ByVal lParam As String) As Long
There is no need to use System.IntPtr, I don't look for system portability
at this time.
Regarding to formatted classes, at this time I don't use it because I see
Win32 APi's are working as well without the use of that encapsulation.
Maybe this is the cause of the problem, but consider that I use API very
very often in .NET (because I wrote automation programs, macro player and
so on), and everything works well without formatted classes.
I tried also the use of StringBuilder class as fouth parameter in the
SendMessageA function, but IE crashes.
If You need other informations, I would be glad to write for You forward.
Please excuse my english, is very poor, I know.
Thank You in advance, Sir.
Ing. GianPiero Andreis