Implementing the "View Source" option in Internet Explorer

.

This is the code for implementing the "View Source" option in Internet Explorer

void CMyBrowser::OnViewSource() 
{
	CWnd* pWnd = NULL; 

	CWnd* pwndShell = m_WebBrowser2.GetWindow(GW_CHILD); // get the webbrowser window pointer

	if (pwndShell) 
	{ 
		pWnd = pwndShell->GetWindow(GW_CHILD);  //get the child window pointer
	} 
	
	if(pWnd != NULL) 
	{ 
		WPARAM wParam = MAKELONG(IDM_VIEWSOURCE, 1);  //convert to unsigned 32 bit value and pass it to WPARAM
		pWnd->SendMessage(WM_COMMAND, wParam, (LPARAM)pWndHTML->m_hWnd); //cool send a message to retreive the source.
	} 	
}

Updated on May 23 1998

IT Offers

Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Go Deeper

  • This buyers guide provides independent research and test results to help you determine your endpoint protection requirements and identify …
  • The penetration of virtual servers is approaching 50 percent in IT infrastructures, yet administrators are only backing up, on average, 68 …
  • This online eBook provides insight and advice on how to build an effective disaster recovery strategy in the evolving world of virtual …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds