본문 바로가기

분류 전체보기94

WebBrowser-Capture IViewObject2 *vObj ; TRect rect = Rect(0, 0, CppWebBrowser1->Width, CppWebBrowser1->Height); Graphics::TBitmap *bmp = new Graphics::TBitmap(); bmp->Width = CppWebBrowser1->Width; bmp->Height = CppWebBrowser1->Height; if(FAILED(CppWebBrowser1->Document->QueryInterface(IID_IViewObject2, (void **)&vObj))) return; OleCheck(vObj->Draw(DVASPECT_CONTENT, 1, NULL, NULL, this->Handle, bmp->Canvas->Handle.. 2008. 8. 14.
IID_IViewObject::Draw void __fastcall TForm1::Button3Click(TObject *Sender) { HRESULT hr; IViewObject *ViewObject; hr=CppWebBrowser1->Document->QueryInterface(IID_IViewObject,(void **)&ViewObject); // hr=CppWebBrowser1->DefaultDispatch->QueryInterface(IID_IViewObject,(void **)&ViewObject); //Document 나 DefaultDispatch 둘다 됩니다. if (SUCCEEDED(hr)) { TRect rc=Rect(0,0,CppWebBrowser1->Width, CppWebBrowser1->Height); Image.. 2008. 7. 21.
ie의 스크롤 영영까지 포함해서 캡쳐하는 팁! http://www.delphipages.com/ 에서 봤던 ie의 스크롤 영영까지 포함해서 캡쳐하는 팁이 있더군요.. 참고하세요..^^ unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, MSHTML, StdCtrls, ExtCtrls, OleCtrls, SHDocVw, gifimage; const IID_IHTMLElementRender: TGUID = '{3050F669-98B5-11CF-BB82-00AA00BDCE0B}'; type IHTMLElementRender = interface(IUnknown) ['{3050F669-98B5-11CF-BB82-.. 2008. 7. 21.
TShellWindows 인데 FindWindow로 변경했을 떄와 같이 HWND를 받을 수 있도록 찾아보자. //--------------------------------------------------------------------------- #include #include #pragma hdrstop #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "shdocvw_ocx" #pragma resource "*.dfm" TForm1 *Form1; //--------------------------------------------------------------------------- __fastcall TForm.. 2008. 7. 18.
TShellWindows #include #include // IHTMLWindow2의 execScript을 이용한 자바호출 void ExecScript(IHTMLDocument2* doc, String script) { if (!doc) return; IHTMLWindow2* win; HRESULT hr = doc->get_parentWindow(&win); if (SUCCEEDED(hr)) { try { VARIANT v; VariantInit(&v); win->execScript( WideString(script), WideString("javascript"), &v ); VariantClear(&v); } __finally { win->Release(); } } } // 자바스크립트 호출 테스트. void __fastca.. 2008. 7. 14.
[BCB] HtmlElements - TTreeView void __fastcall TForm1::Button1Click(TObject *Sender) { // AnsiString c1, c2; GetTextFile("c:\\ssr.txt", c1); Memo1->Lines->Clear(); Memo1->Lines->Add(c1); TTreeNode *node; node = TreeView1->Selected; int stPos, edPos; int cnt = 0; AnsiString tmp = c1; AnsiString tmp2, tmp3; while((stPos = tmp.AnsiPos("")) > 0) { tmp2 = tmp.SubString(stPos, edPos); TreeView1->Items->Add(node, tmp2); tmp = tmp.Su.. 2008. 7. 10.