下面的代码获得CppWebBrowser1控件中的滚动条当前的位置,不知为何总是返回0,请高手指点!
void __fastcall TForm1::CppWebBrowser1DocumentComplete(TObject *Sender,
      LPDISPATCH pDisp, Variant *URL)
{
    int pos= GetScrollPos(CppWebBrowser1->Handle,SB_VERT);
    Edit1->Text=AnsiString(pos);  
}

解决方案 »

  1.   

    Return Values
    If the function succeeds, the return value is the current position of the scroll box.If the function fails, the return value is zero. To get extended error information, call GetLastError.
    BCB的吧 怎么到D版来了。
      

  2.   

    我知道发生了错误,但是错误在那里呢?将CppWebBrowser1->Handle换为RichEdit1->Handle
    就没有问题,迷茫!
      

  3.   

    GetLastError. 看看返回的错误代码是多少。。
      

  4.   

    代码的意思好像是“无法处理非多重文档界面 (MDI) 窗口中的消息”。
      

  5.   

    WebBrowser1里的控件不接收消息