// this is something i grabbed off the net some time ago, // no idea where from and when i recently tried to refind // it i couldnt :( // anyway it gets the web page source from CppWebBrowser....... // if you know Borland C++ RAD and TCppWebBrowser then this is // what you need.......... void __fastcall TForm1::CppWebBrowser1DocumentComplete(TObject *Sender, LPDISPATCH pDisp, TVariant *URL) { static int ct=0; char buff[1000]; String Source; TVariant v2; ct++; if(ct>1) return; CppWebBrowser1->Stop(); IHTMLDocument2 *htm = NULL; // #include if(CppWebBrowser1->Document && SUCCEEDED(CppWebBrowser1->Document->QueryInterface(IID_IHTMLDocument2,(LPVOID*)&htm))){ IPersistStreamInit *spPsi = NULL; // ocidl.h if(SUCCEEDED(htm->QueryInterface(IID_IPersistStreamInit, (LPVOID*)&spPsi)) && spPsi){ IStream *spStream = NULL; // objidl.h OleCheck(CreateStreamOnHGlobal(NULL, true, &spStream)); if(spStream) { __int64 nSize = 0; STATSTG ss; LARGE_INTEGER nMove; nMove.QuadPart = 0; OleCheck(spPsi->Save(spStream, true)); OleCheck(spStream->Seek(nMove, STREAM_SEEK_SET, (ULARGE_INTEGER*)&nSize)); OleCheck(spStream->Stat(&ss, STATFLAG_NONAME)); nSize = ss.cbSize.QuadPart; Source.SetLength(nSize); OleCheck(spStream->Read((void *)Source.data(), nSize, (ULONG*)&nSize)); OleCheck(spStream->Release()); } spPsi->Release(); } htm->Release(); } strcpy(buff,Source.c_str()); // buff now contains the web page source code }