我想知道为什么我不能获的网页句柄?应该用什么方法来得到网页句柄?

解决方案 »

  1.   

    FindWindow('IEFrame', nil);//得到网页句柄
    FindWindow('IEFrame', '网页句柄? - Microsoft Internet Explorer');//得到你这个提问页面句柄
      

  2.   

    网页里面的控件,比如说edit 它好像是网页自己写进去的。  它不跟我们程序里面的edit 一样。所以要得到他的句柄也不能用一般的方法。可是我不知道怎样得到它,更不知道怎样得到edit里面的内容。请问那个位仁兄会,请教一下。写下代码让我研究一下会更好。谢谢!
      

  3.   

    那NI在WC多呆一会児、就有人回答了。hehe~~不知NI用什麼方式打開的网页?若用OLE方式就可比較方便的控制网页procedure TForm1.Button30Click(Sender: TObject);
    var
      IEApp,Docs,ovElements: OLEVariant;
      i: integer;
    begin {uses Comobj; }
      IEApp := CreateOLEObject('InternetExplorer.Application');
      IEApp.Visible := True;
      IEApp.Navigate('http://www.csdn.net/member/login.asp');
      while IEApp.ReadyState < READYSTATE_COMPLETE do
        Application.ProcessMessages;  Docs := IEApp.Document;
    //-- <input name=login_name ID="login_name">
      ovElements := Docs.GetElementByID('login_name');
      ovElements.Value :='your_UserName';
    //-- <input type=password name=password ID="password">
      ovElements := Docs.GetElementByID('password');
      ovElements.Value :='your_Password';//-- <input type="image" src="/member/images/go.gif">
      ovElements := Docs.all.tags('INPUT');
      for i := 0 to (ovElements.Length - 1) do
        if UpperCase(ovElements.item(i).type) = 'IMAGE' then
          ovElements.item(i).Click;
    end;説明:上述SOURCE本来是可自働登録CSDN的、現在CSDN変更不能用了、
       只是提供参考
      

  4.   

    楼上的兄弟,你的这个方法不行.比如说我现在写入了csdn.net登陆的密码,但还未点进入,这时edit框是星号,我现在就想看到里面写的是什么内容!  谢谢!就是这么简单!