|
|
Thanks for saving me valuable time .
To scroll to the bottom with CDHtmlDialog, simply call the CDhtmlFunction GetInterface memberfunction
IHTMLElement2 *pElement = NULL;
if(SUCCEEDED(GetElementInterface(_T("SpanList"),IID_IHTMLElement2,(void**)&pElement)))
{
long lHeight;
pElement->get_scrollHeight(&lHeight);
pElement->put_scrollTop(lHeight);
pElement->Release();//It's not a smart pointer
}
Tout programme dont la fiabilité dépend de l'homme n'est pas fiable
|
|
|
|
|
Hi,
I need to change the size (width not the scroll range) of scroll bar shown in the Web Browser control.
Does any body have any idea how to do this ???
Thanx
Wasif
|
|
|
|
|
Unfortunately i had the same problem but it seems to be impossible, maybe you could make your own (either MFC control or Javascript)
Tout programme dont la fiabilité dépend de l'homme n'est pas fiable
|
|
|
|
|
My project is SDI. In MyProView, I use CDC pointer to TextOut string in multiline. So, I need use scrolling to view each page. Please, help me how to use Scrollbar or give me some same small application.
Thanks very much.
don't stop me now!!!
|
|
|
|
|
does any one know how to seperate pictures or any resource files from webbrowser control? i want to seperate and save them as seperate file. any idea?
hi,i am an engeneer and studieng now.meet me at talk_wert@yahoo.com
|
|
|
|
|
Hi,
I am trying to get it done using C#, but I am not going anywhere...
can anyone help me.
Any hints pls.
( I already have a simple WebBrowser Object, I need to get the position of the Scroll Bar)
|
|
|
|
|
IHTMLDocument2 htmlDoc = (IHTMLDocument2)m_browser.Document;
htmlDoc.parentWindow.scroll(100, 100);
|
|
|
|
|
With that code I'm getting a compilation error:
Cannot convert type 'System.Windows.Forms.HtmlDocument' to 'mshtml.IHTMLDocument2'.
Any ideas?
|
|
|
|
|
Scroll to absolute position [adapted from C# example]
webbrowser1.document.window.parent.scrollto(x,y)
But:
Anyone know how to get the current 'y', so one could scroll relative to the current position?
|
|
|
|
|
There is also a HtmlElement.ScrollIntoView Method in .NET 2.0, very useful .
|
|
|
|
|
This is how you do it in C# using VS 2005:
Add a COM reference in your project to mshtml (shows up as "Microsoft HTML Object Library" in the Add Reference dialog).
Add the following to your buttonDown Clicked handler:
private void buttonDown_Click(object sender, EventArgs e)
{
HtmlDocument doc = webBrowser1.Document;
if (doc == null)
return;
mshtml.IHTMLDocument2 htmlDoc = (mshtml.IHTMLDocument2)doc.DomDocument;
htmlDoc.parentWindow.scrollBy(0, 100);
}
|
|
|
|
|
1.As you know IE or Any browser use HTTP Connection they first download the main page and then links in them , our Internet connection is slow and i want to be be it fast browser so i want that HTML page text content is dowloaded and rendered and stop at that moment as gif's or Jpeg files eat the time to download , i am using IE ctrl in my application to atomate for some purpose, i tried to stop in OnNavigateComplete2WebBrowser but it not work , i found article in MSDN in (Reusing the WebBrowser Control) and found the following section i copied from MSDN
(Download Control:-
Hosts can control certain aspects of downloading, such as frames, images, Java, and so on, by implementing an ambient property defined as DISPID_AMBIENT_DLCTL. When the host'sIDispatch::Invoke method is called with dispidMember set to DISPID_AMBIENT_DLCTL, it should place zero or a combination of the following values in pvarResult...)
2.i am writing direct mailer, so it need MX record finding , that is done if you have you DNS Server address known , i hear that GetNetworkParam works but in online MSDN it is given to include "iphlpapi.h" and this and "iphlpapi.lib" but these i not find in our VC++ 6.0 Enterprise edition library.
3.How to scroll data in CScrolView window greater than 32k lines , i tried by bypassing the Scrollmsgs using hooks,it works but not smoothly , as VC++ binary editor|RichEdit scroll > 32k
|
|
|
|
|
Thank for your good work.It works well.
But now i have got a problem. can we get the whole height & width the scroll bar will scroll?
Does anybody could help me out?? thank you
|
|
|
|
|
Hi,
I want to be able switch on and off the execution of ActiveX controls in my code. Does anyone know how this is possible?
Thanks
|
|
|
|
|
I am facing a problem catching the scroll bar events in CHtmlView class. I have tried to use the OnScroll() method of the view class but it does not seems to work at all. If anyone know the way, please help me out of this problem.
regards
Humphrey Chakma
|
|
|
|
|
After the scroll bar is moved by clicking mouse manually, how to get scroll bar position information in program?
|
|
|
|
|
You can write the code below to get the scroll bar position....
HRESULT hr;
// get the document dispatch from browser
IDispatch *pDisp = GetHtmlDocument();
ASSERT( pDisp ); //if NULL, we failed
IHTMLDocument2 *pDocument = NULL;
hr = pDisp->QueryInterface( IID_IHTMLDocument2, (void**)&pDocument );
ASSERT( SUCCEEDED( hr ) );
ASSERT( pDocument );
IHTMLElement *pBody = NULL;
hr = pDocument->get_body( &pBody );
ASSERT( SUCCEEDED( hr ) );
ASSERT( pBody );
// from body we can get element2 interface,
// which allows us to do scrolling
IHTMLTextContainer *pContainer = NULL;
hr = pBody->QueryInterface(IID_IHTMLTextContainer,(void**)&pContainer);
ASSERT(SUCCEEDED(hr));
ASSERT( pContainer );
CPoint ScrollPos;
pContainer->get_scrollTop(&ScrollPos.x);
pContainer->get_scrollLeft(&ScrollPos.y);
CString str;
str.Format("Top: %ld, Left: %ld", ScrollPos.x, ScrollPos.y);
AfxMessageBox(str);
pDisp->Release();
Hope this will do for you.
Humphrey Chakma
|
|
|
|
|
Here is a version of the code that does not require the updated SDK. This version works with the default Visual C++ 6.0 installation.
HRESULT hr;
// get the document dispatch from browser
IDispatch *pDisp = wBrowser.GetDocument();
ASSERT( pDisp ); //if NULL, we failed
IHTMLDocument2 *pDocument = NULL;
hr = pDisp->QueryInterface( IID_IHTMLDocument2, (void**)&pDocument );
ASSERT( SUCCEEDED( hr ) );
ASSERT( pDocument );
IHTMLWindow2 *pWindow = NULL;
hr = pDocument->get_parentWindow( &pWindow );
ASSERT( SUCCEEDED( hr ) );
ASSERT( pWindow );
pWindow->scrollBy( 0, delta );
pDisp->Release();
|
|
|
|
|
|
Is there a way to GET the scrollbar positions without using IHTMLElement2?
|
|
|
|
|
Have you found a way to obtain the scroll position? The non-IHTMLElement2 version does scroll to the specified position properly while the IHTMLElement2 version didn't. Is this what you found? The scroll problems appear to be caused by newer versions of IE. There has to be a way to get the current position or I'm not sure why you would need scroll-to unless you wanted to move to the beginning or end of the display.
|
|
|
|
|
I like this way!thx!
I am not a genius, but shed more sweat!
|
|
|
|
|
Hi,
I have a webbrowser control in my dialog and it shows a right side (vertical) scrollbar which i dont want it to show or any of the scrollbars..Please help me out..
how can i do that..Thanks a lot in advance..
Regards,
Himanshu
|
|
|
|
|
Great Code Do Yahoo Messenger Uses Code like this for Main Chat window.
If we go on adding new HTML Data to the control how can we make sure that scrollbar always remains at the bottom and dose'nt Moves Up and Down
As in case of IDE when we use Ctrl + Page Down in the output window whatever ouput may be generated but we can see the last line always same for Yahoo Messenger Main Chat window.
|
|
|
|