|
새창이 뜰경우 새 탭을 이용해서 창을 띄우려고 하는데..
어떤사이트에서는 되는데 특정 사이트에서는 페이지가 로딩되지 않습니다.
현재 제가 해논 소스는 이것인데...
이소스에 문제가 있는지 좀 봐주셧으면 합니다.
void __fastcall TForm1::CppWebBrowser1NewWindow2(TObject *Sender,
LPDISPATCH *ppDisp, VARIANT_BOOL *Cancel)
{
char TabName[50];
pts[TabNameCount] = new TTabSheet(Page);//새탭 페이지 만들기
pts[TabNameCount]->PageControl = Page;
memset(TabName,0,50);
sprintf(TabName,"%s%d","Tab",TabNameCount);
pts[TabNameCount]->Name=TabName;
pts[TabNameCount]->Caption="로딩중";
SelTab=TabNameCount;
PosiBox->Items->Add(SelTab);
web[TabNameCount] = new TCppWebBrowser(pts[TabNameCount]);
web[TabNameCount]->ParentWindow = pts[TabNameCount]->Handle;
web[TabNameCount]->Width = pts[TabNameCount]->Width - 3;
web[TabNameCount]->Height=pts[TabNameCount]->Height - 3;
web[TabNameCount]->RegisterAsBrowser=true;
web[TabNameCount]->RegisterAsDropTarget=true;
web[TabNameCount]->OnStatusTextChange=CppWebBrowser1StatusTextChange;
web[TabNameCount]->OnDownloadBegin=CppWebBrowser1DownloadBegin;
web[TabNameCount]->OnNewWindow2= CppWebBrowser1NewWindow2;
web[TabNameCount]->OnDownloadComplete = CppWebBrowser1DownloadComplete;
web[TabNameCount]->OnWindowClosing=CppWebBrowser1WindowClosing;
Page->ActivePageIndex=Page->PageCount-1;
(* ppDisp)=web[TabNameCount]->Application;
}
|