????? ?????? ??? IHTMLDocument2 ?? HWND

???? ???????: 249232 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

??????

???? ??? ?????? ????? ?????? ??? ????? IHTMLDocument2 ?? HWND. ??? ?? ????? ??????? ?????? Microsoft "(MSAA) ? ????? ????? ????? WM_HTML_GETOBJECT ??? ???? ??????? (???????? ??? ??????"Explorer_Server ??????") ??? ?? ?????? ?????? ?? SendMessage ???? MSAA ObjectFromLresult ? ?????? ??? ???? IHTMLDocument2 ?????? ???? ????.

??????? ????

??? ?? ???? ???? ?????? Active Accessibility ???? ??? ?????? ?????? ??? ????????? ???????? ???????? ?? ??? ?????? ?????. ???? ?? ?????? ?????? ?????? SDK ????? ????????? Active Accessibility ????????. ?? ???? ????? ???? ????? ?? Active Accessibility ????? ??????? ????? ?? ??????? ?????? ??? ????? ?????? ??? ??????? (RDK) ?????? ??????? ?? Microsoft Windows 95 ?? Windows 98 ?? Windows NT 4.0 ?? Service Pack 4 ?? 5. ??? ?? ??????? ????? RDK ?????? ????? ??? Windows 2000 ?? Windows NT 4.0 ?? Service Pack 6. ??? ????? ?????? ????? ?????? ?? ????? ??????? ???.

???? ??? "???????" ?? ??? ??????? ?????? ??? ??????? ??? Active Accessibility ??? ??? ?????? SDK ??????? ??????.
#include <mshtml.h>
#include <atlbase.h>
#include <oleacc.h>

BOOL CALLBACK EnumChildProc(HWND hwnd,LPARAM lParam)
{
	TCHAR	buf[100];

	::GetClassName( hwnd, (LPTSTR)&buf, 100 );
	if ( _tcscmp( buf, _T("Internet Explorer_Server") ) == 0 )
	{
		*(HWND*)lParam = hwnd;
		return FALSE;
	}
	else
		return TRUE;
};

//You can store the interface pointer in a member variable 
//for easier access
void CDlg::OnGetDocInterface(HWND hWnd) 
{
	CoInitialize( NULL );

	// Explicitly load MSAA so we know if it's installed
	HINSTANCE hInst = ::LoadLibrary( _T("OLEACC.DLL") );
	if ( hInst != NULL )
	{
		if ( hWnd != NULL )
		{
			HWND hWndChild=NULL;
			// Get 1st document window
			::EnumChildWindows( hWnd, EnumChildProc, (LPARAM)&hWndChild );
			if ( hWndChild )
			{
				CComPtr<IHTMLDocument2> spDoc;
				LRESULT lRes;
			
				UINT nMsg = ::RegisterWindowMessage( _T("WM_HTML_GETOBJECT") );
				::SendMessageTimeout( hWndChild, nMsg, 0L, 0L, SMTO_ABORTIFHUNG, 1000, (DWORD*)&lRes );

				LPFNOBJECTFROMLRESULT pfObjectFromLresult = (LPFNOBJECTFROMLRESULT)::GetProcAddress( hInst, _T("ObjectFromLresult") );
				if ( pfObjectFromLresult != NULL )
				{
					HRESULT hr;
					hr = (*pfObjectFromLresult)( lRes, IID_IHTMLDocument, 0, (void**)&spDoc );
					if ( SUCCEEDED(hr) )
					{
						// Change background color to red
						spDoc->put_bgColor( CComVariant("red") );
					}
				}
			} // else document not ready
		} // else Internet Explorer is not running
		::FreeLibrary( hInst );
	} // else Active Accessibility is not installed
	CoUninitialize();
}
				
??????: ??? Internet Explorer 5.5 ? ???????? ???? ?? ??????? ?? ???? ??????? ???? ???? ?? Shdocvw.dll ? ??? ??? ???? ???? ????? ?????? ??. ???? Internet Explorer 5.5 ?????? ???????? ?????? ?????? ??? ???? ???? ?? ??? ????? ???? ???????? ??? ???? ??? Shdocvw.dll. ??? ??? ?? ???? ???? HWND ??? ???? Internet Explorer 5.5 ?????????? ??????, ???? ????? ???????? ???????? ???????? ?? ??? ?????? ?????? ??? ??????? ?????? ??????? ???. ????? ???? ?????? ??? ?? ???? ??????? ???????? ?????? ???????? ?? ??????? ???????.

?????

SDK ???????? ? RDK ???? ???? ?????? ?????? ??? ????? Active Accessibility ??? ???? ??????? ????? ??????? ?? ???? Microsoft ?????? ??? ?????:
http://www.microsoft.com/downloads/details.aspx?FamilyID=9b14f6e1-888a-4f1d-b1a1-da08ee4077df&DisplayLang=en
?????? ??? ??????? ??? ??? Microsoft Active Accessibility ??????? ?? ??? ???? MSHTML Microsoft Internet Explorer ?????? ???? ????? ??????:
http://msdn.microsoft.com/workshop/browser/accessibility/overview/overview.asp
????? ?? ?????????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
176792????? ??????? ???? ??? ????? ?? Internet Explorer

???????

???? ???????: 249232 - ????? ??? ??????: 04/?????/1427 - ??????: 3.0
????? ???
  • Microsoft Internet Explorer 4.0 128-Bit Edition
  • Microsoft Internet Explorer 4.01 Service Pack 2
  • Microsoft Internet Explorer 4.01 Service Pack 1
  • Microsoft Internet Explorer 4.01 Service Pack 2
  • Microsoft Internet Explorer 5.0
  • Microsoft Internet Explorer 5.5
????? ??????: 
kbmt kbhowto kbmshtml kbwebbrowser KB249232 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????249232
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

????? ???????