system::delphiinterface<ihtmleventobj> htmlevt;
disp = this->cppwebbrowseraddfriend->document;
if(!disp)
return;
htmldoc2 = disp;
htmldoc2->get_parentwindow(&htmlwnd2);
htmlwnd2->get_event(&htmlevt);
long key;
htmlevt->get_keycode(&key);
if(int(key) == 13)
{
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();
pvarresult->vt = vt_bool;
pvarresult->boolval = false;
}
if(int(key) == 27)
{
this->close();
pvarresult->vt = vt_bool;
pvarresult->boolval = false;
}
}
void tfrmaddfriend::setfocusinput(ansistring itemname)
{
//todo: add your source code here
_di_idispatch disp;
system::delphiinterface<ihtmldocument2> htmldoc2;
system::delphiinterface<ihtmlelementcollection> htmlelemcoll;
system::delphiinterface<ihtmlelement2> htmlelem2;
disp = this->cppwebbrowseraddfriend->document;
if(!disp)
return;
htmldoc2 = disp;
htmldoc2->get_all(&htmlelemcoll);
htmlelemcoll->item(tvariant(itemname),tvariant(0),&disp);
if(!disp)
return;
htmlelem2 = disp;
htmlelem2->focus();
}
void __fastcall tfrmaddfriend::formdestroy(tobject *sender)
{
this->releasehook();