Re: How to catch web page script "moveto()" in CHtmlView?

From: jeff (bloodchen_at_hotmail.com)
Date: 04/25/04


Date: Mon, 26 Apr 2004 00:45:27 +0800

Hi Igor,

I followed your instruction and set a breakpoint at my
CWebBrowser2::PreTranslateMessage function. But it seems the
WM_WINDOWPOSCHANGING never comes to this function. How do you catch it? May
I have a look of your sample code?

Thanks

"Igor Tandetnik" <itandetnik@mvps.org> wrote in message
news:uxSu5kHKEHA.2456@TK2MSFTNGP12.phx.gbl...
> "Su Wei" <suwei@sina_com> wrote in message
> news:uJ7cPXHKEHA.2776@TK2MSFTNGP12.phx.gbl
> > I used spy++ and find that WM_WINDOWPOSCHANGING is always first sent
> > from "Shell Embedding". But I use "Shell Embedding" keywords to
> > search and no useful info available, so what's this window?
>
> It's the window of WebBrowser control. Its class name is undocumented,
> and you need not care about it (except maybe for debugging and research
> purposes). Like I said, the HWND of this window is available with
> IOleWindow::GetWindow.
>
> > and even
> > though I change popup window width and height according to Q259963,
> > the chtmlview still got scrollbars.
>
> I don't understand what you are saying. Q259963 shows how to determine
> the size WebBrowser control wants to have, not how to change it to what
> you want. Am I missing something?
>
> > I learn the ie control draws
> > scrollbars but how and when ie query width and height of his
> > container?
>
> Still no clue what you are talking about, sorry.
>
> I thought there's more than one trip but I don't know the
> > direction to dig in, such as IOleInPlaceSite, subclass and hook etc.
> > Below is code from mfc so the scrollbars is someborders special?
> > void CHtmlView::OnSize(UINT nType, int cx, int cy)
> > {
> > CFormView::OnSize(nType, cx, cy);
> >
> > if (::IsWindow(m_wndBrowser.m_hWnd))
> > {
> > // need to push non-client borders out of the client area
> > CRect rect;
> > GetClientRect(rect);
> > ::AdjustWindowRectEx(rect,
> > m_wndBrowser.GetStyle(), FALSE, WS_EX_CLIENTEDGE);
> > m_wndBrowser.SetWindowPos(NULL, rect.left, rect.top,
> > rect.Width(), rect.Height(), SWP_NOACTIVATE | SWP_NOZORDER);
> > }
> > }
>
> I don't see anything about scrollbars here. Whenever CHtmlView is
> resized, it resizes the WebBrowser control to completely cover the
> view's client area.
> --
> With best wishes,
> Igor Tandetnik
>
> "For every complex problem, there is a solution that is simple, neat,
> and wrong." H.L. Mencken
>
>



Relevant Pages

  • Re: How to catch web page script "moveto()" in CHtmlView?
    ... It's the window of WebBrowser control. ... > the chtmlview still got scrollbars. ... it resizes the WebBrowser control to completely cover the ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: How I can show the scrollbar as needed?
    ... IE opens pop-up windows which are without address ... With the WebBrowser control in my application, ... I want to create an appropriate window (with or without address bar, ... without address & scrollbars, or it is a normal window. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Webbrowser control looses sessionid on "newwindow"
    ... begin navigation and that the following onclick event which uses javascript ... I just did a test with your test page in my own shdocvw browser. ... If the new_window event is cancelled, ... instance of the webbrowser control), ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Webbrowser control looses sessionid on "newwindow"
    ... I haven't gone to the trouble of creating a beresque browser to test your ... webbrowser control this will open a new instance of Internet Explorer on the ... contrains info and this window has the "Server Error" page. ... Navigate to that page and click the link. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Connecting to a running instance of an embedded webBrowser con
    ... Open Spy++ if you have it, and get the classname for the window you are after (the browser itself) ... There are Win32 functions that allow code to access other processes, the main window, child windows, etc.. ... className should be that of the WebBrowser control, and windowName can be specified as null. ...
    (microsoft.public.dotnet.languages.csharp)