//---------------------------------------------------------------------------
#include <classes.hpp>
#include <controls.hpp>
#include <stdctrls.hpp>
#include <forms.hpp>
#include "shdocvw_ocx.h"
#include <olectrls.hpp>
//---------------------------------------------------------------------------
class tfrmaddfriend : public tform
{
__published: // ide-managed components
tcppwebbrowser *cppwebbrowseraddfriend;
void __fastcall formcreate(tobject *sender);
void __fastcall cppwebbrowseraddfrienddocumentcomplete(tobject *sender,
lpdispatch pdisp, variant *url);
void __fastcall formdestroy(tobject *sender);
private:
void moveformevt(dispid id, variant* pvarresult);
void moveform(void);
void maskevt(dispid id, variant* pvarresult);
void setbrowserstyle(void);
void cancelevt(void);
void releasehook(void);
void addfriendonclick(dispid id, variant* pvarresult);
ansistring getinputvalue(ansistring itemname);
void onkeypressevt(dispid id, variant* pvarresult);
void setfocusinput(ansistring itemname);
void putinputvalue(ansistring itemname, ansistring value); // user declarations
public: // user declarations
ansistring mbnum;
ansistring friendname;
ansistring id8751;
ansistring info;
__fastcall tfrmaddfriend(tcomponent* owner);
};
//---------------------------------------------------------------------------
extern package tfrmaddfriend *frmaddfriend;
//---------------------------------------------------------------------------
#endif
.cpp
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "addfriendform.h"
#include "globalfunc.h"
#include "globalvar.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "shdocvw_ocx"
#pragma resource "*.dfm"
tfrmaddfriend *frmaddfriend;
//---------------------------------------------------------------------------
__fastcall tfrmaddfriend::tfrmaddfriend(tcomponent* owner)
: tform(owner)
{
}
//---------------------------------------------------------------------------
void __fastcall tfrmaddfriend::formcreate(tobject *sender)
{
this->cppwebbrowseraddfriend->handleneeded();
this->cppwebbrowseraddfriend->navigate(widestring(getrespath("addfriends.htm")),null,null,null,null);
cutformrgn(handle,316,225);
}
//---------------------------------------------------------------------------
void tfrmaddfriend::moveformevt(dispid id, variant* pvarresult)
{
//todo: add your source code here
_di_idispatch disp;
system::delphiinterface<ihtmldocument2> htmldoc2;
system::delphiinterface<ihtmlwindow2> htmlwnd2;
system::delphiinterface<ihtmleventobj> htmlevt;
system::delphiinterface<ihtmlelement> htmlelem;
disp = this->cppwebbrowseraddfriend->document;
if(!disp)
return;
htmldoc2 = disp;
htmldoc2->get_parentwindow(&htmlwnd2);