| 发表于:2007-01-16 15:31:58 楼主 |
option explicit private declare function findwindowex lib "user32.dll " alias "findwindowexa " (byval hwnd1 as long, byval hwnd2 as long, byval lpsz1 as string, byval lpsz2 as string) as long private declare function movewindow lib "user32.dll " (byval hwnd as long, byval x as long, byval y as long, byval nwidth as long, byval nheight as long, byval brepaint as long) as long private type rect left as long top as long right as long bottom as long end type private sub command1_click() dim tdoc as mshtml.htmldocument dim tiv as iviewobject dim trc as rect dim tow&, toh&, tsw&, tsh& tow = webbrowser1.width toh = webbrowser1.height set tdoc = webbrowser1.document set tiv = tdoc tdoc.body.scroll = "no " tsw = tdoc.body.scrollwidth + 4 tsh = tdoc.body.scrollheight + 4 dim thdl& thdl = getwebhwnd() movewindow thdl, 0, 0, tsw, tsh, 0 trc.right = tsw trc.bottom = tsh picture1.cls picture1.move picture1.left, picture1.top, tsw, tsh ***************************************************************** tiv.draw dvaspect_content, 1, byval 0, byval 0, _ 0&, picture1.hdc, trc, trc, byval 0, byval 0 **************************************************************** 这个地方出错了 : 提示: byref 参数类型不符 **************************************************************** tdoc.body.scroll = "yes " movewindow thdl, 0, 0, tow, toh, 1 savepicture picture1.image, "c:\web.bmp " picture1.cls end sub private sub form_load() webbrowser1.navigate "www.pconline.com.cn " end sub private sub webbrowser1_newwindow2(ppdisp as object, cancel as boolean) cancel = true end sub private function getwebhwnd() as long dim thdl& thdl = findwindowex(me.hwnd, 0, "shell embedding ", " ") if thdl <> 0 then thdl = findwindowex(thdl, 0, "shell docobject view ", " ") if thdl <> 0 then getwebhwnd = thdl end if end if end function 大家帮看看程序到底错在那里?? 谢谢 |
|
|
|
|