Hi Vaclav,
> I am attempting slightly customise Microsoft WebBrowser
> control. I got the easy stuff working (handles of its
> windows etc.) but most problems resist. Specifically:
>
> 1. When the control navigates to a web page with a big
> picture, it shows scrollbars. I need to resize the
> control so its right margin will match the right margin
> of the picture and the scrollbar disappear. In fact I
> need to know the scollbars maximum. It is somehow
> strange, since the GetScrollInfo fails with either of
> the three WebBrowser sub-windows I was able to find.
> This suggests that it has non-standart scrollbars. But
> the control responds to WM_HScroll SendMessage. So I
> am rather confused.
You can wrap the image in an HTML document and have it display that
way. Set the border of the body to zero. Here's a html wrapper you
might use:
<html>
<body
scroll="no"
border="0"
margin="0"
style="border:0;margin:0;cursor:default;"
onload="focus();"
ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"
ncontextmenu="event.returnValue=false;"
onkeydown="if(event.keyCode==27){try{window.opener.focus();}catch(x)
{};setTimeout('window.close();',10);}event.returnValue=false;" >
<img src="yourpicture.jpg" border="0" />
</body>
</html>
> 2. I need the browser to find and highlight a specific
> word in a html page without prompting user. I guess it
> can be done by using Web1.ExecWB OLECMDID_FIND,
> OLECMDEXECOPT_DONTPROMPTUSER, in, out but i do not
> know how to pass correct in and out values to find
> certain string.
I think for the search to function correctly you've got to let the
user supply the keyword first. I wouldn't bother with that though.
There's a demo of manipulating the content of a webbrowser control
located on Edanmo's VB Page. I believe it's in the tips area.
http://www.domaindlx.com/e_morcillo/default.asp
Regards,
Shawn K. Hall
http://ReliableAnswers.com