CB6中使用浏览器控件的一些操作[8]

[入库:2005年8月19日] [更新:2007年3月24日]

本文简介:选择自 3996906 的 blog

                        this->windowstate = wsminimized ;
                }
                else if(str == widestring("ok"))
                {
                        this->mbnum = this->getinputvalue("mbnum");
                        this->friendname = this->getinputvalue("name");
                        this->id8751 = this->getinputvalue("id");
                        this->info = this->getinputvalue("memtextarea");
                        this->modalresult = mrok;
                        this->close();
                }
                else if(str == widestring("cancel"))
                {
                        this->modalresult = mrcancel;
                        this->close();
                }
        }
        pvarresult->vt = vt_bool;
        pvarresult->boolval = false;
}
//---------------------------------------------------------------------------
void __fastcall tfrmaddfriend::cppwebbrowseraddfrienddocumentcomplete(
      tobject *sender, lpdispatch pdisp, variant *url)
{
        this->cancelevt();
        this->setbrowserstyle();
        this->moveform();

        _di_idispatch disp;
        system::delphiinterface<ihtmldocument2> htmldoc2;
        system::delphiinterface<ihtmlelement> htmlelem;

        disp = this->cppwebbrowseraddfriend->document;
        if(!disp)
                return;

        htmldoc2 = disp;
        htmldoc2->get_body(&htmlelem);

        tvariant vt;
        vt = cfunctionobject<tfrmaddfriend>::createeventfunctionobject(this,&tfrmaddfriend::addfriendonclick,0);
        htmlelem->put_onclick(vt);

        vt = cfunctionobject<tfrmaddfriend>::createeventfunctionobject(this,&tfrmaddfriend::onkeypressevt,0);
        htmlelem->put_onkeypress(vt);

        this->setfocusinput("mbnum");
}
//---------------------------------------------------------------------------
void tfrmaddfriend::onkeypressevt(dispid id, variant* pvarresult)
{
        //todo: add your source code here
        _di_idispatch disp;
        system::delphiinterface<ihtmldocument2> htmldoc2;
        system::delphiinterface<ihtmlwindow2> htmlwnd2;

本文关键:CB6中使用浏览器控件的一些操作
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top