请问有关问题:如何获取Internet Explorer_Server中的内容

请教问题:怎么获取Internet Explorer_Server中的内容
已经可以获以某个窗口内的子窗口“Internet Explorer_Server”控件对象,怎样获取该对象html的内容或标题或者url。下面是vb一个函数不知道如何转成vfp的。

  '  
  ' IEDOMFromhWnd  
  '  
  ' Returns the IHTMLDocument interface from a WebBrowser window  
  '  
  ' hWnd - Window handle of the control  
  '  
  Function IEDOMFromhWnd(ByVal hWnd As Long) As IHTMLDocument  
  Dim IID_IHTMLDocument As UUID  
  Dim hWndChild As Long  
  Dim lRes As Long  
  Dim lMsg As Long  
  Dim hr As Long  
   
  If hWnd <> 0 Then  
   
  If Not IsIEServerWindow(hWnd) Then  
   
  ' Find a child IE server window  
  EnumChildWindows hWnd, AddressOf EnumChildProc, hWnd  
   
  End If  
   
  If hWnd <> 0 Then  
   
  ' Register the message  
  lMsg = RegisterWindowMessage("WM_HTML_GETOBJECT")  
   
  ' Get the object pointer  
  Call SendMessageTimeout(hWnd, lMsg, 0, 0, _  
  SMTO_ABORTIFHUNG, 1000, lRes)  
   
  If lRes Then  
   
  ' Initialize the interface ID  
  With IID_IHTMLDocument  
  .Data1 = &H626FC520  
  .Data2 = &HA41E  
  .Data3 = &H11CF  
  .Data4(0) = &HA7  
  .Data4(1) = &H31  
  .Data4(2) = &H0  
  .Data4(3) = &HA0  
  .Data4(4) = &HC9  
  .Data4(5) = &H8  
  .Data4(6) = &H26  
  .Data4(7) = &H37  
  End With  
   
  ' Get the object from lRes  
  hr = ObjectFromLresult(lRes, IID_IHTMLDocument,_  
  0, IEDOMFromhWnd)  
   
  End If  
   
  End If  
   
  End If  
   
  End Function

------解决方案--------------------
要转成 vfp 的代码有一个问题,就是 EnumChildWindows 这个 api 函数,它的第二个参数需要传入一个回调函数指针,而 vfp 是不存在函数指针的,简单的解决方法有两种:
1. 改用 FindWindowEx api 函数,并自己写循环,遍历所有子窗口,检测子窗口类名
2. 使用 vfp2c32.fll 中的 CreateCallbackFunc 函数来得到回调函数地址,vfp2c32 可以到 http://vfp2c.dyndns.org/ 去下载,附带的示例中就有一个使用回调函数调用 EnumWindows api 函数的示例,我的 blog 中也有一篇生成简版 vfp2c32.fll 的文章可参考。